siit-webdev-47 / treasure-hunt-game

1 stars 0 forks source link

Moving the player beyond map margin should not trigger energy consumption #17

Closed RaresGherasim closed 1 week ago

RaresGherasim commented 4 weeks ago

Right now, if the player reaches the edge of the map, trying to move beyand the edge it will move it one tile over the edge , then it will bring it back, triggering a new move, new redraw and new calculation of energy.

The validation of the movement should be done before the movement, not after.