I need help with delta time execution...

Get help using Construct 2

Post » Tue Mar 14, 2017 2:36 pm

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.
Image
Image
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.
Image
But it simple dosent work.. the only way that i make it run was if i put like this.
Image
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/
B
28
S
9
G
2
Posts: 84
Reputation: 2,889

Post » Tue Mar 14, 2017 2:57 pm

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.
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027

Post » Tue Mar 14, 2017 3:12 pm

i try to a fixed value, but it would not work.. as i said..
Image
or the sintax is wrong?
B
28
S
9
G
2
Posts: 84
Reputation: 2,889

Post » Wed Mar 15, 2017 9:20 am

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.
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests