dt gaps in endless runner

Get help using Construct 2

Post » Wed Jan 30, 2013 11:41 pm

hi there!

i would like to solve dt and floor() gaps using built-in behaviours and plug-ins (so i could eventually still upload to the arcade).

i have been recreating the example tutorial from another program for an endless runner for construct. when i tried to make it framerate independant gaps began to appear in the object spawning so i left it out to complete the tutorial.

another problem appeared - when the run speed is not a factor of 32 (the ground size) it creates gaps in the floor because floor() is used to get rid of the remainder in the ground spawning code, so it doesn't randomly stop spawning the ground because the runspeed isn't a factor of 32.


if any one has some ideas to help fix the floor() rounding gaps i would very much appreciate it. is framerate independance important in an endless runner type game?
Posts: 136
Reputation: 3,210

Post » Thu Jan 31, 2013 2:38 am

[QUOTE=Tokinsom] You can get rid of the gap in the tiles by "offsetting" them based on an integer variable rather than moving them individually by, say, 60*dt.[/QUOTE]
Taken from yesterday's thread on this. Basically you don't move anything by itself and instead set all objects' positions to a (integer) variable minus their original positions. The variable is always counting down - moving the objects left in perfect sync and preventing any gaps/seams. Eventually you reset this variable which is the tricky part since some tiles will still be on-screen. Might need 2 variables, the second based on the first. That's one way to do it atleast.

If you're just using basic strips of land you can maybe pin each new one to the end of the last one.
Posts: 1,776
Reputation: 18,153

Return to How do I....?

Who is online

Users browsing this forum: cjbruce, Zoussu and 16 guests