0 Favourites

I need help with delta time execution...

  • Hello.

    im doing a runner game that objects apear in the screen in a specific time.

    So im usin dt, to get time of a layout running as in the image below... the dt ads a value to a global number.

    So in my logic when te value of the global number tempo was equal to a value a number of events would ocour, as in the image below.

    But it simple dosent work.. the only way that i make it run was if i put like this.

    but in the long run, the game loses sync because the element does not apear in the right time.

    Can anyone please help me out??

    Here you can see the game

    http://www.gameorb.com.br/games/asd/

  • try using instead of dt -> a fixed value 0.1 or 0.2

    dt is frame rate dependent which may go up or down based on device it runs and how intensive is the game.

    that means it wont add only 0.1 but can also add 0.12 or 0.112341 or 2.123 which will surpass the math your using there...

    also another factor would be that tempo is changing everytick and there is not enough time for the bellow conditions to happen, since by the time they are triggered tempo is already changed.

    see if you add to tempo every dt or 0.025 what happens. as a second solution.

    P.S when you say long run what that means, time frame i mean? i played for about 1 minute (painful 1 minute cause i cant predict the cars coming in which after 5 -6 hits you die and game resets) everything looks ok here.

  • i try to a fixed value, but it would not work.. as i said..

    or the sintax is wrong?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • sintax seems good, its a positioning issue, try enlarge the preview screen and see where actually spawns, do a 5000 preview pixel width and see if something appears outside,

    also is there any condition that destroys the objects created if their outside? it might be the objects are created just a tad bit outside the area u want them and being deleted.

    if you have a capx of it we could take a look at it, or send it in PM if you dont want it to get public.

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