The code now works, and you can control the player with the arrow keys.