def __init__(self, trainer):
        """ Initialize the Marathon Controller """
        self.marathon = Marathon()
        self.trainer = trainer
        screen = MarathonScreen(self.marathon)

        cmds = {commands.SELECT: self.select, commands.EXIT: self.stopRunning}
        PygameController.__init__(self, screen, commands=cmds)
예제 #2
0
 def __init__(self, trainer):
     """ Initialize the Marathon Controller """
     self.marathon = Marathon()
     self.trainer = trainer
     screen = MarathonScreen(self.marathon)
     
     cmds = {commands.SELECT:self.select,
             commands.EXIT:self.stopRunning}
     PygameController.__init__(self, screen, commands=cmds)
예제 #3
0
class MarathonController(PygameController):
    """ Controller for a Marathon """
    
    def __init__(self, trainer):
        """ Initialize the Marathon Controller """
        self.marathon = Marathon()
        self.trainer = trainer
        screen = MarathonScreen(self.marathon)
        
        cmds = {commands.SELECT:self.select,
                commands.EXIT:self.stopRunning}
        PygameController.__init__(self, screen, commands=cmds)
                     
    def select(self):
        """ Performs a Select """
        if self.marathon.beaten():
            self.stopRunning()
        else:
            zone = self.marathon.loadZone()
            self.runController(ZoneController(self.trainer, zone, 1, 2, doneCallback=self.marathon.beaten))
예제 #4
0
class MarathonController(PygameController):
    """ Controller for a Marathon """
    
    def __init__(self, trainer):
        """ Initialize the Marathon Controller """
        self.marathon = Marathon()
        self.trainer = trainer
        screen = MarathonScreen(self.marathon)
        
        cmds = {commands.SELECT:self.select,
                commands.EXIT:self.stopRunning}
        PygameController.__init__(self, screen, commands=cmds)
                     
    def select(self):
        """ Performs a Select """
        if self.marathon.beaten():
            self.stopRunning()
        else:
            zone = self.marathon.loadZone()
            self.runController(ZoneController(self.trainer, zone, 1, 2, doneCallback=self.marathon.beaten))