Beispiel #1
0
    def runLevelDummy(self, user_name):

        working = runBox.run(self.map_path, self.level, user_name)
        #working = self.sand.start(self.map_path)
        output = open("output.py","r")
        if working:
            if self.level == 6:
                maze.create_maze()
                self.filetomap(self.map_path)
                self.hood()
                self.py=0
                self.px=0
            elif self.level == 5:
                self.initBinary()
            import runLevel as run
            reload(run)
            for y in xrange(self.height):
                for x in xrange(self.width):
                    if(self.grid[y][x].getType()=="PLANE"):
                        self.py = y
                        self.px = x
            #establish the path to pass along to GUI
            self.dummy = True
            self.plane.setDummy(True)
            self.plane.setHeading(0)
            try:
                run.runLevel(self.plane)
            except CrashException:
                pass;
                #do nothing, these are just to keep the user
                #code from executing forever
            self.dummy = False
            self.plane.setDummy(False)
#        else:
            #display error message??
        #TODO get this working?
        return working; 
Beispiel #2
0
    def runLevelDummy(self):

        working = runBox.run(self.map_path)
        #working = self.sand.start(self.map_path)
        output = open("output.py","r")
        print working
        if working:
            #establish the path to pass along to GUI
            self.dummy = True
            self.plane.setDummy(True)
            try:
                run.runLevel(self.plane)
            except CrashException:
                pass;
            except VictoryException:
                pass; 
                #do nothing, these are just to keep the user
                #code from executing forever
            self.dummy = False
            self.plane.setDummy(False)
#        else:
            #display error message??
        #TODO get this working?
        return working;