def gameLoop(self): """ The Actual game loop. handles prompting and flow-of-action logic """ fleed = 'False' # for determining if fleed. If they flee, they must leave room immediately as opposed to exploring it won = False #winning variable self.printIntro() self.playGame = self.startBool() while (self.playGame): self.createPlayer() self.playLoop = True while (self.playLoop): ######PLAY LOOOP##################### room = self.layout.getCurrentRoom() if room.getIsItemSpawnPoint( ) == True: #Generate item if it is random, so I can print itemName = room.getItemName() object = self.items.getItem(itemName) itemName = object.getName() room.changeItemName(itemName) if room.isSafeRoom() == True: #win if at safe room won = True if not won: spawn = room.getSpawnPoint() #spawn if zombies may be present. The battle manager handles the case where #zombies may be present but 1 or more zombies are dead. (ie came back into a room) if spawn == True: bm = BattleManager.BattleManager( self.player, room.getZombies()) fleed = bm.battleLoop(room) if self.player.isAlive() == True: if fleed == True: #if fleed, they must exit room immediately. If they choose to stay in room, battle will recommence self.leaveRoom() else: self.exploreOptions() if not self.player.isAlive(): self.playLoop = False else: self.playLoop = False ######END PLAY LOOP if won == True: print( '\n\n\nCONGRATS. LEVEL 1 of 1 COMPLETED. YOU WIN!!!!!!!!!!' ) else: print('\n\n\nYOU LOSE') print('\n\n\nWould you like to play again?') self.playGame = self.startBool() print( "Thanks for playing Rowan Zombie Survival Guide. Hope you enjoyed!" )
"They do not ask questions, because they need the Laustwand. Which idiot would bite the hand that feeds?" ) sceneManager.speak( captain, "Well, isn't it ironic? You were so close to freeing the Laustwan.") sceneManager.speak( captain, "After all, these plants here are the only good ones left. We lost a lot of them in our war against the pirates." ) sceneManager.speak( captain, "And that's why we will guard these plantation, no matter what! Now die!" ) battleManager = BattleManager.getBattleManager() won = battleManager.runBattle( ["captain", "war mage", "captain"], annchienta.Surface("images/backgrounds/kimen.png"), False) currentMap.removeObject(captain) sceneManager.quitDialog() if won: sceneManager.initDialog([august, avril, march]) sceneManager.speak( avril, "Did you hear that? We have to destroy this plantation, quick!") sceneManager.speak( august,
inputManager = annchienta.getInputManager() inputManager.setInteractKey(annchienta.SDLK_SPACE) # Init SceneManager. import SceneManager SceneManager.init() sceneManager = SceneManager.getSceneManager() # Init PartyManager. import PartyManager PartyManager.init() partyManager = PartyManager.getPartyManager() # Init BattleManager. import BattleManager BattleManager.init() # Start Main menu. import Menu import MenuItem # Display a splash image. removed for quicker testing purposes #splashImage = annchienta.Surface( "images/backgrounds/splash.png" ) start = engine.getTicks() #while engine.getTicks() < start + 1000: # videoManager.clear() # videoManager.drawSurface( splashImage, 0, 0 ) # videoManager.flip() #sceneManager.fade( 255, 255, 255, 2000 ) # Load a title background.