I am trying out the 8way direction behavior on a scrolling spaceship. The movement is great, but my problem is that I wanted to do some action when the player is in a certain area, and moving in a certain direction.
Normally when I would do movement, I would handle the input. Each Tick, while Up Arrow pressed: Add 1 to player Y. This way, I could also do something like move something else +1. But with 8Way, I'm not sure how to capture that event or that number (position) without comparing it. This would require me to set a instance variable such as LastKnownY and currentY.
Does anyone have suggestions or best practices around movement that is easily tracked? Such as if player moves 2 pixels, I can move something else 2 pixels. If there is a way to do this with 8way, that would be great.