public void keyReleased(KeyEvent e) {
        int key = e.getKeyCode();

        if (key == KeyEvent.VK_LEFT) {
            directionX = 0;
        }

        if (key == KeyEvent.VK_RIGHT) {
            directionX = 0;
        }

        if (key == KeyEvent.VK_UP) {
            directionY = 0;
        }

        if (key == KeyEvent.VK_DOWN) {
            directionY = 0;
        }
    }