Check if Player is moving?

TwilightHunterTwilightHunter Member Posts: 146
edited November -1 in Working with GS (Mac)
Hey, quick question fellas.
I'm using a joystick that I created using the Joystick tutorial found in the Support center, and I have it working really nicely. I'm making a Top-Down view game, and the player's animations go up, down, left and right, even though he can actually move in any direction. I'm even using the game.Angle attribute to check which direction the player is facing, in order to change his animation accordingly.
Example:
If game.Angle is Greater than 45º but Less than 135º, change attribute game.PlayerDirection to 1 (up is 1, right is 2, down is 3, left is 4)
Now my problem is this just checks the direction, so I can make him change which way he is facing, but what if he is running in that direction? If so, I want him to change his animation to Running. But first I need to check if he is actually moving. Is there a function I can use for that? He moves using the Move function, so is there a way to say:
If game.Angle is Greater than 45º but Less than 135º change game.PlayerDirection to 1.
(Player Actor)
If self.movement is Greater than 1 and game.PlayerDirection is 1, change animation to Running Up
Any help would be great, thanks!

Comments

Sign In or Register to comment.