How do I Set maximum rotation speed

Get help using Construct 2

Post » Wed Oct 29, 2014 4:28 pm

Hello, i am using rotate behaviour. Speed set to 0 and acceleration set to -5. I would like to set maximum speed of the rotation. Because it accelerates to infinity. How can i do this?
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Wed Oct 29, 2014 6:14 pm

You will need to access its controls via an event and change them when you want this to happen.

When you do an action on the object with the rotate behavior assigned you get the options to "set speed" and "set acceleration" allowing you to change these.
You will need to decide when you want to stop it accelerating and set it to 0 at that point.
If its a time thing then use a system event that deals with time and then action out to changing the speed/acceleration.
If its a click, collision, or overlapping event then action out of it via the object.

You could always not set its speed and rotation in its initial properties and instead set them via the actions I mention above at On-creation event or On-Start-of-layout, etc.

You could also grab its current speed/acceleration via the objects "expressions" (the window that pops up with low opacity behind your action window when your making an action) using Sprite.Rotate.Acceleration or speed. You would need to have an event that stored this into an instance variable and then compares it to what you want the max to be and then stops it when it is equal/greater.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
69
S
18
G
8
Posts: 639
Reputation: 9,549

Post » Wed Oct 29, 2014 7:20 pm

Thank you, will try and let know what was the best solution
B
11
S
3
G
1
Posts: 419
Reputation: 1,782


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests