Infinitely Scrolling Vertical Background

Get help using Construct 2

Post » Fri Nov 14, 2014 8:56 am

Hello I'd like to chime in with my solution.

I have a tiled background that is the width of the window and 2x the height of the window. This allows me to start the layout with the bottom of the tiled background flush with the bottom of the window, and the top of the tiled background protruding from the window at the top.

Given the origin of the tiled background is its top left corner, I was able to set a trigger for when its Y >= 0. Make sure you set a second condition of Trigger once while true. With that trigger, give it an action to create an instance of the tiled background, with a Y of negative the height of the tiled background. For instance, my window height is 800, so because my tiled background is double the height, its height is 1600. So in this case I would create the new tiled background with a Y set to -1600. This creates the instance immediately behind the first instance.

Then set the tiled background to destroy itself when its Y >= the window height. So mine destroys whenever its Y >= 800.

And then of course to make it actually move I just do an Every Tick trigger. Every tick I set the tiled backgrounds Y to Tiledbackground.Y + (dt * speed), and you can plug in any integer to replace speed.
Posts: 31
Reputation: 703

Post » Fri Nov 14, 2014 12:17 pm

DoobieDoctor5000 you mean like this
You do not have the required permissions to view the files attached to this post.
Posts: 2,045
Reputation: 44,123


Return to How do I....?

Who is online

Users browsing this forum: Strawoy and 4 guests