dt gaps in endless runner

0 favourites
  • 2 posts
From the Asset Store
Endless runner
$4 USD
60% off
Template for an endless runner game, fully documented in comments and video
  • 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.

    https://www.dropbox.com/s/bvupkq6urq9qxnr/endlessrunner.capx

    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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)