Exemple #1
0
 def switchin(self, *args):
     """args should be a tuple of exactly 1 element, a Formation object"""
     State.switchin(self)
     if len(args) > 1:
         raise ValueError("MainGame.switchin() should take 1 or fewer arguments!")
     if len(args) == 1:
         if not isinstance(args[0],Formation):
             raise ValueError("MainGame.switchin() needs a Formation object!")
     if len(args) == 1:
         self.playerFlock.changeFormation(args[0])
         #register sprites
         self.screen.add(self.playerFlock)
         #no widgets to register
         #switch camera
         self.screen.cam = roughTrack(self.playerFlock.anchor.position)