Need some help with direction buttons

The thing is I'm trying to make encounter rate system. Here is an example that I made.

1640262836403.png


It's worked perfectly well but then, I realized that when my character is facing the wall and I still pressing up arrow, the variable is keep counting.

1640262688419.png



Is there a way to solve this problem? It will be really weird if the character didn't move and that bar keep goes up on its' own.
use control variables to get the players current position stored.
then two conditional branches comparing current position to past position. if they are different then update past position and count up, if they are identical do nothing
If you dont need your overall step counter then you could also use the step counter put it in a variable and just make a c.branch like if 100 steps then do this... and reset it at the end.
Thank you both of you!
Now, my encounter rate won't do something weird anymore.

Original thread: https://forums.rpgmakerweb.com/threads/need-some-help-with-direction-buttons.143257/