now the player smoothly avoids the walls