public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_UP)
                ya = -game.getSpeedx();
            if (e.getKeyCode() == KeyEvent.VK_DOWN)
                ya = game.getSpeedx();
            if (e.getKeyCode() == KeyEvent.VK_RIGHT)
                xa = -game.getSpeedx();
            if (e.getKeyCode() == KeyEvent.VK_LEFT)
                xa = game.getSpeedx();
        }