In my game, i’m controlling the sprite character movement by the x and y position when the player touch the gamepads…
Simple as that:
sprite.x = sprite.x + motionx;
He is moving, ok. But, he can move anywhere in the screen resulting in that:
The sprite is supposed to push the box, but he can push from anywhere…
I want the sprite to push the box from point A to point B. The way he is moving right now this can be hard as the player and box not follows a path.
Is that confuse?
Think on a grid… I want always the character to move 1 cel to another, or 1 row to another. Not 1/2 of the current cel, or 1/4, always to another cell.
How can i accomplish that?