-
Maximum movement speed
Hi
I have a Player object which move in the X direction ( left and right ) by using 2 AlterableValues:
- Input_ ( ranges from -5 to 5, the user controls the input by holding the left and right arrow buttons )
- Environment_ ( Push/ gravity fields in the level affect the Players environment AlterableValue )
( Both components values represent movement in pixles )
...
Player also has a MaxSpeed_ value which defines the maximum speed of which the Player object can move in either X direction ( left or right ).
...
How can i limit Players movement speed to Players MaxSpeed_?
-
New Condition: Player Moves Right (or forward)
+ Alt.Value [Moving_Speed] < Alt.Value [MaxSpeed]
for the other direction, maybe
New Condition: Player Moves Left (or backward)
+ Alt.Value [Moving_Speed] < Alt.Value [MaxSpeed] *-1
or maybe reverse the < for >, I guess.
Alt.Value [Moving_Speed] > Alt.Value [MaxSpeed] *-1