1 // main game loop 2 while (App.IsOpened()) 3 { 4 pOurPlayer->CheckInput(); 5 6 cpSpaceStep(pMap->GetSpace(), 1.0f/60.0f); 7 8 /* clear screen and draw map */ 9 App.Clear(sf::Color(200, 200, 200, 255)); 10 11 pMap->Draw(pOurPlayer->GetBody()); 12 13 // Update all the bullets in the world 14 GameData.UpdateBullets(pOurPlayer->GetBody()); 15 16 // check for items as well 17 GameData.UpdateItems(pOurPlayer->GetBody()); 18 19 // Finaly update all enemies 20 GameData.UpdateEnemies(pOurPlayer->GetBody()); 21 22 pOurPlayer->Draw(); 23 24 App.Display(); 25 26 if (CheckGameEnd(&App)) 27 { 28 App.Close(); 29 break; 30 } 31 }