1 if (pOurPlayer->mu32Health == 0) 2 { 3 // Check for Lives? 4 if (u32Lives > 0) 5 { 6 Sleep(1000); 7 u32Lives--; 8 delete pOurPlayer; 9 pOurPlayer = new SmashPcPlayer(GameData, &App, pMap->GetSpace(), 10 pMap->GetSpawnLocation(), &Weapon); 11 } 12 else 13 { 14 // just quit I guess 15 GameSound::Play("GameOver"); 16 Sleep(4000); 17 break; 18 } 19 } 20 21 if (GameData.IsLevelOver()) 22 { 23 U32 u32OldArmor = pOurPlayer->mu32Armor; 24 BOOL bGameOver = FALSE; 25 26 // Change Level 27 if (Level == NumLevels) 28 { 29 bGameOver = TRUE; 30 } 31 else 32 { 33 Level++; 34 } 35 36 // Call the intermission function 37 // also handles end-game 38 Intermission(&App, pMap, pOurPlayer, &GameData, bGameOver, 39 u32ScreenX, u32ScreenY); 40 41 // Reset GameData to make sure everything is cleared 42 GameData.Reset(); 43 delete pOurPlayer; 44 delete pMap; 45 46 // Create new amp with new level data 47 pMap = new SmashPcMap(Levelnames[Level-1].c_str(), GameData, &App); 48 49 Weapon.AssignSpace(pMap->GetSpace()); 50 51 // Start player at new spawn locations 52 pOurPlayer = new SmashPcPlayer(GameData, &App, pMap->GetSpace(), 53 pMap->GetSpawnLocation(), &Weapon); 54 55 // reset old armor 56 pOurPlayer->mu32Armor = u32OldArmor; 57 }