Example #1
0
 def check_cutscene(self):
     if gui.current_card == 4:
         self.mode = PLAYING
         gui.current_card = None
         for s, l in env.key_bindings.items():
             if self.keys[s]:
                 for u in l:
                     u.activate()
         level.save()
         timer.unpause()
         self.fade_countdown = 0.5
     if len(event.cutscene_queue) > 0:
         for u in physics.unit_update_list:
             if u.uses_keys:
                 u.deactivate()
         self.mode = CUTSCENE
         timer.pause()
         cutscene_card = cutscene.Cutscene("Data/Cutscenes/" + event.cutscene_queue[0] + ".txt", gui.state_goer(4))
         event.cutscene_queue = event.cutscene_queue[1:]
         gui.current_card = cutscene_card
         gui.next_card = None
         gui.transition_time = 0.5
Example #2
0
 def toggle_pause(self):
     if self.mode == PLAYING:
         if level.player == None or event.end_game:
             return
         self.mode = PAUSED
         for u in physics.unit_update_list:
             if u.uses_keys:
                 u.deactivate()
         pausescreen.init_pause()
         timer.pause()
         env.main_window.set_mouse_visible(True)
     elif self.mode == PAUSED:
         self.mode = PLAYING
         music.update_volume()
         gui.current_card = None
         gui.next_card = None
         gui.transition_time = 0.0
         for s, l in env.key_bindings.items():
             if self.keys[s]:
                 for u in l:
                     u.activate()
         timer.unpause()
         env.main_window.set_mouse_visible(False)
         self.fade_countdown = 0.5