@Override
        public void keyPressed(KeyEvent event) {
            int key = event.getKeyCode();
            if (isRunning) {
                if (key == KeyEvent.VK_UP || key == KeyEvent.VK_RIGHT || key == KeyEvent.VK_DOWN || key == KeyEvent.VK_LEFT)
                    player.move(key);
            }

            if (key == KeyEvent.VK_P) isRunning = !isRunning;
        }