def epicBattle(self, mission, seed=0): globalvars.disable_menu = True #Disable the standard menu for now. rd.seed(seed) #Fix the seed for the random number generator. wipeOldScenario(); resetDust() globalvars.BGIMAGE = image_list['bggalaxies'].convert() spacing = 50 n = 3 #Make n+1 enemy units starting to the left of the player: start = (globalvars.player.rect.centerx-500, globalvars.player.rect.centery) for i in range(n+1): enemy_ship = hudHelpers.getNewEnemy(start[0],start[1]+spacing*i,\ 'destroyer',2,2,2,2,2) hudHelpers.addNewEnemyToWorld(enemy_ship) #Add an enemy capital ship enemy_ship = hudHelpers.getNewCapitalShip(start[0],start[1]+spacing*n) hudHelpers.addNewEnemyToWorld(enemy_ship) #Make n friendly units: start = (globalvars.player.rect.centerx+500, globalvars.player.rect.centery) add_to_blue = True for i in range(n): friendly_ship = hudHelpers.getNewEnemy(start[0],start[1]+spacing*i,\ 'ship',2,2,2,2,2) friendly_ship.theta = 179.0 #Face the ship to the left hudHelpers.addNewEnemyToWorld(friendly_ship,\ add_to_team=globalvars.team_manager.player_team) #Add a friendly capital ship friendly_ship = hudHelpers.getNewCapitalShip(start[0],start[1]+spacing*n) hudHelpers.addNewEnemyToWorld(friendly_ship,\ add_to_team=globalvars.team_manager.player_team) #Make the score keeper: time_limit = 120 #time limit in seconds text = ['BATTLE COMPLETED'] #Display timer and score count with the following: globalvars.score_keeper = displayUtilities.TimeLimitDisplay(text, \ points_to_win=103, time_limit=time_limit, mission=mission) globalvars.intangibles_top.add(globalvars.score_keeper) #Draw the new background and flip the whole screen. globalvars.screen.blit(globalvars.BGIMAGE, (0,0)) pygame.display.flip() #Display the intro to the mission globalvars.menu.setBasicTextPanel(['You have '+str(time_limit)+' seconds to defeat the enemy team and prevent your team from being defeated.','Your team is to the right. The enemy team is to the left.'])
def capitalShipScenario(self, mission, seed=0): globalvars.disable_menu = True #Disable the standard menu for now. rd.seed(seed) #Fix the seed for the random number generator. wipeOldScenario(); resetDust() globalvars.BGIMAGE = image_list['bggalaxies'].convert() #Make the capital ship enemy_ship = hudHelpers.getNewCapitalShip(0,400) hudHelpers.addNewCapitalShipToWorld(newship) #Create the score keeper. time_limit = 30 #time limit in seconds text = ['CAPITAL SHIP BATTLE COMPLETED'] #Display timer and score count with the following: globalvars.score_keeper = displayUtilities.TimeLimitDisplay(text, \ points_to_win=100, time_limit=time_limit, mission=mission) globalvars.intangibles_top.add(globalvars.score_keeper) #Draw the new background and flip the whole screen. globalvars.screen.blit(globalvars.BGIMAGE, (0,0)) pygame.display.flip() #Display the intro to the mission globalvars.menu.setBasicTextPanel(['You have '+str(time_limit)+' seconds to defeat the capital ship to win.'])