public void game() throws MessagingException {
        try {
            usedTime=1000;
            SZYBKOSC=Integer.parseInt(readFile("src/poziom.txt"));
            initWorld();
            while (isVisible() && !gameEnded)
            {
                while (isVisible() && !gameEnded && !pause) {
                    
                    updateWorld();
                    checkCollisions();
                    paintWorld();
                    
                    try
                    {
                        Thread.sleep(SZYBKOSC);
                    }
                    catch (InterruptedException e) {}
                    //}}
                }
            }
            paintGameOver();
            saveFile("src/wyniki.txt");
        } catch (IOException ex) {
            Logger.getLogger(WojnaSwiatow.class.getName()).log(Level.SEVERE, null, ex);
        }
        
  
     }