Use the mobile controller or the keys When the player stops moving then stop the game
All code by me It may have some bugs