Keyboard input causes game to freeze

.