Skip to content
Discussion options

You must be logged in to vote

Create a new object for your leaf and spawn a bunch of them off-camera in intervals with some initial speed set

Step:

x += your_horizontal_speed
y += your_positive_vertical_speed

Then draw them with an offset to make them appear closer to the camera than the foreground

Draw:

var offset_x = camera_get_x(view_current) * 0.5
var offset_y = camera_get_y(view_current) * 0.25

draw_sprite(sprite_index, image_index, x - offset_x, y - offset_y);

Adjust the offset multiplier until you get the effect you want. The higher the multiplier, the faster leaves will scroll. You don't need to use the background parallax system for this (you wouldn't anyway)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Otukuoi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants