Timedelta problem

For questions about using Classic.

Post » Fri Aug 22, 2008 12:39 pm

Using timedelta is supposed to make your game "framerate independent" right?

http://www.mediafire.com/?whyuwuuhunh

Try running this cap in both unlimited and v-synced framerate mode and see which one goes faster.
On my comp, v-synced moves "normally" and unlimited flies right off the screen.

I'm propably just stupid, but if anyone knows how to make it work I would like to know how.
B
2
S
1
G
4
Posts: 71
Reputation: 1,342

Post » Fri Aug 22, 2008 1:49 pm

Ekhem
Always (every tick) -> Add 5*timedelta to 'asd'
If you have unlimited frame rate then you have like about 400fps for example to it adds 400 times a second "5*timedelta to 'asd'" if you have v-syns you have about 75/60 (depends on your monitor refresh rate) so it will add only 75/60 times a second.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Fri Aug 22, 2008 1:59 pm

basically the value asd is like the velocity right?

so when you add to it it's like acceleration

acceleration is measured in distance over time squared
- the "squared" intuatively telling you you need two timedeltas.

you need one for the change of velocity over time, and one for the change in position over time

what it should be to make it independent of framerate is:

System: Always (every tick)
> SpriteAdd 5*timedelta to 'asd'
> SpriteSet Y to Sprite 0 .y+Sprite 1 .value('asd')*timedelta

hope thats clear
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Fri Aug 22, 2008 2:47 pm

Ok, Thanks a lot for quick answers!
B
2
S
1
G
4
Posts: 71
Reputation: 1,342


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests