public void keyPressed(KeyEvent key)
    {
        message = "";
        switch (key.getKeyCode())
        {
            case 37:
                if (westDoor.isActive())
                {
                    processDoor(Maze.Direction.WEST);
                }
                break;
            case 39:
                if (eastDoor.isActive())
                {
                    if (levelSolved)
                    {
                        pentathlon.newLevel();
                    }
                    else
                    {
                       processDoor(Maze.Direction.EAST);
                    }
                }
                break;
            case 38:
                if (northDoor.isActive())
                {
                    processDoor(Maze.Direction.NORTH);
                }
                break;
            case 40:
                if (southDoor.isActive())
                {
                    processDoor(Maze.Direction.SOUTH);
                }
        }
        checkExit();
        repaint();
    }