Question about object timescale

Get help using Construct 2

Post » Thu Apr 12, 2012 10:42 pm

Ok so we all know you can set objects' timescales independently from the game's timescale.

So, in theory, you could pause the entire game (set timescale to 0) yet have certain objects remain active (set their timescales to 1) right? Wrong :<

After tinkering around for a bit I got this to work by moving an object using n*self.dt instead of n*dt, then setting the timescale to 0 and the object's timescale to 1.

Works great.

But..

Is that the right way to do this?

If that's the case, then every object you want to remain active when the game's timescale is 0 would have to be programmed using self.dt instead of just dt, which in a sense makes just dt obsolete, which makes me feel like I'm not doing this right.Tokinsom2012-04-12 23:57:25
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Fri Apr 13, 2012 9:32 am

You're right, you need to use Self.dt for any objects that change timescale independently of the game timescale. Otherwise you can just use dt.

It has to be like that, because if you use just 'dt' everywhere, its value is used for everything so it's impossible to vary the timestep for different objects.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to How do I....?

Who is online

Users browsing this forum: TELLES0808 and 12 guests