Gestione controlli

protected void keyPressed(int key)
{
    super.keyPressed(key);
    if (getGameAction(key)==Canvas.DOWN)
    {
        if (volCont.getLevel() > 0)
        {
            volCont.setLevel(volCont.getLevel() - 10);
        }
    }
    else if (getGameAction(key)==Canvas.UP)
    {
        if (volCont.getLevel() < 80)
        {
            volCont.setLevel(volCont.getLevel() + 10);
        }
    }
    else if (getGameAction(key) == Canvas.RIGHT)
    {
        if (playerState == PAUSE_LABEL)
        {
            startPlayer();
        }
        else if (playerState == STOP_LABEL)
        {
            try
            {
                buildPlayer();
                startPlayer();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            catch (MediaException e)
            {
                e.printStackTrace();
            }
        }
    }
    else if (getGameAction(key) == Canvas.LEFT)
    {
        if (playerState == PLAY_LABEL)
        {
            stopPlayer();
        }
        else if (playerState == PAUSE_LABEL)
        {
            closePlayer();
        }
    }
    repaint();
}