Added a new logic to the player movements