Timedelta question.

For questions about using Classic.

Post » Fri Aug 20, 2010 4:16 pm

Do I need to use timedelta on everything?

If I'm going to do something like: always:add 1 to angle. To save having to put timedelta all over the place, can I just use the timer instead? Like: every millisecond: add 1 to angle. Would save a lot of timedelta placings...
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Fri Aug 20, 2010 4:30 pm

[quote="alspal":1f70rjh0]Do I need to use timedelta on everything?

If I'm going to do something like: always:add 1 to angle. To save having to put timedelta all over the place, can I just use the timer instead? Like: every millisecond: add 1 to angle. Would save a lot of timedelta placings...[/quote:1f70rjh0]
You can't do the exact example "every millisecond". Reasons can be read here and in other threads.

You need timedelta where you want to make sure, that something is changed independently of the framerate. It doesn't make much sense here, but for more complex code that you use repeatingly you can always set up a function call, e.g.

+on function "convert"
->Function: Set return value to Function.Param(1) * TimeDelta

you would then call always: add Function.convert(1) to angle
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Aug 20, 2010 4:38 pm

You want to use timedelta on anything that changes over time. Don't use 'every' for that, because every isn't accurate past the frame rate, i.e. if your frame rate is 10fps, "every 1 ms" will trigger 10 times per second.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Fri Aug 20, 2010 8:39 pm

Also remember that timescale is based on timedelta.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests