public void keyReleased(KeyEvent e){
        if(e.getKeyCode() == KeyEvent.VK_D){
            setXDirection(0);
        }
        if(e.getKeyCode() == KeyEvent.VK_A){
            setXDirection(0);
        }
    }