@Override
    public void keyPressed(KeyEvent e) {
        // TODO Auto-generated method stub
        if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
            right = true;
        }

        if (e.getKeyCode() == KeyEvent.VK_LEFT) {
            left = true;
        }

        if (e.getKeyCode() == KeyEvent.VK_UP) {
            up = true;
        }

        if (e.getKeyCode() == KeyEvent.VK_DOWN) {
            down = true;
        }

        if (e.getKeyCode() == KeyEvent.VK_SPACE) {
            space = true;
        }

    }