public void pauze()
    {
        for (int i = 0; i < level.length; i++) 
        {
            for (int j = 0; j < level[0].length; j++) 
            {
                Iterator<GameObject> it = level[i][j].getGameObjects().iterator();
                while(it.hasNext()) 
                {
                    GameObject object = it.next();
                    if(object != null && object instanceof Ghost)
                    {
                        ((Ghost) object).pauzeTimer(true);
                    }
                    if(object != null && object instanceof Pacman)
                    {
                        ((Pacman) object).pauzeTimer(true);
                    }
                }
            }
        }
        pauzeTimer(true);
        repaint();
    }