public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_W)
            ya = -game.getSpeedx();
        if (e.getKeyCode() == KeyEvent.VK_S)
            ya = game.getSpeedx();
        if (e.getKeyCode() == KeyEvent.VK_A)
            xa = -game.getSpeedx();
        if (e.getKeyCode() == KeyEvent.VK_D)
            xa = game.getSpeedx();
    }