• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED] Help setting background hspeed by code

H

Holy Moly

Guest
I have an object that draws parallax backgrounds. I used the following code in the draw event of the object:

Code:
draw_background_tiled(gradient1, view_xview, view_yview/1.22);
draw_background_tiled(clouds1_back, view_xview/1.01, view_yview/1.22);
draw_background_tiled(hills1, view_xview/1.14, view_yview/1.22);
draw_background_tiled(clouds1, view_xview/1.3, view_yview/1.55+172);
How can I make clouds1 background constantly move to the right? I know that setting the background_hspeed[0...7] to a positive number will make it scroll right; but I don't get how to attach that value to the background I want to scroll (in this case clouds1).

Thanks in advance!
 

obscene

Member
background_hspeed is for the built-in background layers. Since you are manually drawing just add a variable.

draw_background_tiled(gradient1, view_xview+some_value, view_yview/1.22);

Then increase some_value in your step event.
 
Top