Coding the player walk cycle