public void keyPressed(KeyEvent e)
    {
        int code = e.getKeyCode();

        if(code == P)
        {
            keyP = true;
        }

        if (code == R1 || code == R2)
        {
            rightKey = true;
            dir = RIGHT;
        }

        if (code == L1 || code == L2)
        {
            leftKey = true;
            dir = LEFT;
        }

        if (code == U1 || code == U2)
        {
            if(!isAirborn() && !upKey)
            {
                upKey = true;
            }

            else
            {
                upKey = false;
            }
        }
    }