Checking to see if the hero has taken a step is surprisingly easy!
You'll need 5 variables:
Hero X - Holds the Hero's current X coordinate
Hero Y - Holds the Hero's current Y coordinate
Last X - Holds the Hero's previous X coordinate
Last Y - Holds the Hero's previous Y coordinate
Steps - Amount of steps taken
The idea is that when we detect that Hero X/Y and Last X/Y have different values, it means the character would've moved one space! Then all you need is a parallel process enabled by a switch that does the following:
CODE
Last X = Hero X
Last Y = Hero Y
Hero X = Hero's Current X Coordinate
Hero Y = Hero's Current Y Coordinate
IF Hero X is not equal to Last X
Steps + 1
Else
IF Hero Y is not equal to Last Y
Steps + 1
End IF
End IF
IF Steps greater than 100
Steps = 100
End IF
And you can replace 100 with whatever the maximum amount of steps is (that is if you want a maximum, if not you'll need to adjust your code to cap the gauge out at a maximum or weird stuff will happen).
This post has been edited by Vanit: Jun 27 2011, 06:15 AM