@Override
    public void keyPressed(KeyEvent e)
    {

        switch(e.getKeyCode())
        {
            case VK_D:
                isDDown = true;
                break;
            case VK_A:
                isADown = true;
                break;
            case VK_SPACE:
                isSpaceDown = true;
                break;
            case VK_ESCAPE:
                paused = !paused;
                if(paused)
                    state = State.PAUSE;
                else state = State.GAME;
                break;
            case VK_W:
                isWDown = true;
                break;
        }
    }