Limiting acceleration

For questions about using Classic.

Post » Sun Oct 16, 2011 11:31 am

With the Custom Movement behavior, is it possible to limit acceleration? I tried always setting a private variable on the object to the speed of the object, and then only activating the event when the speed was under a certain number, but it caused the object to "stick" at the max speed.
B
8
S
2
G
2
Posts: 144
Reputation: 1,588

Post » Tue Oct 18, 2011 2:24 am

You can use clamp(a,b,c)

a being the change, b the lowest value and c the highest, so you would set the c value to the maximum speed.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Tue Oct 18, 2011 3:43 pm

I had a Custom Player Movement thing going on in my game for awhile (though I ended up using 8 player movement). I did get what I think you want accomplished through this:

Compare: Object[CustomMovement].Speed > MaxSpeed
--> Set Object, CustomMovement, Change Speed, Set MaxSpeed
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Thu Oct 20, 2011 7:31 am

Sorry I didn't reply sooner, I've been having computer issues. Again.

Thanks for the replies, both solutions work well! I've been creating a set of AIs that control space based fighter craft and capital ships, because the RTS behavior gets old after awhile...
B
8
S
2
G
2
Posts: 144
Reputation: 1,588


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests