adding more game logic in the keydownHandler