Beispiel #1
0
 def setGridGame(self, gameName):
     if gameName == 'Random':
         gameName = random.choice(['MineSweeper', 'Roll', 'Avoid', 'Drag'])
     self.gridGame = gameName
     if hasattr(self, 'game'):
         self.game.delete()
         self.game = None
     if gameName == 'Drag':
         self.game = LaserGameDrag.LaserGameDrag(self.trapDisable,
                                                 self.trapFire,
                                                 self.sendField,
                                                 self.setGrid)
     elif gameName == 'MineSweeper':
         self.game = LaserGameMineSweeper.LaserGameMineSweeper(
             self.trapDisable, self.trapFire, self.sendField, self.setGrid)
     elif gameName == 'Roll':
         self.game = LaserGameRoll.LaserGameRoll(self.trapDisable,
                                                 self.trapFire,
                                                 self.sendField,
                                                 self.setGrid)
     elif gameName == 'Avoid':
         self.game = LaserGameAvoid.LaserGameAvoid(self.trapDisable,
                                                   self.trapFire,
                                                   self.sendField,
                                                   self.setGrid)
     else:
         self.game = LaserGameMineSweeper.LaserGameMineSweeper(
             self.trapDisable, self.trapFire, self.sendField, self.setGrid)
     self.game.startGrid()
     self.sendField()
     self.sendUpdate('setGridGame', [gameName])
     return
    def setGridGame(self, gameName):
        if gameName == "Random":
            gameName = random.choice(["MineSweeper", "Roll", "Avoid", "Drag"])

        self.gridGame = gameName
        #print("setting Grid Game %s" % (gameName))
        if hasattr(self, 'game'):
            self.game.delete()
            self.game = None

        if gameName == "Drag":
            self.game = LaserGameDrag.LaserGameDrag(self.trapDisable,
                                                    self.trapFire,
                                                    self.sendField,
                                                    self.setGrid)
        elif gameName == "MineSweeper":
            self.game = LaserGameMineSweeper.LaserGameMineSweeper(
                self.trapDisable, self.trapFire, self.sendField, self.setGrid)
        elif gameName == "Roll":
            self.game = LaserGameRoll.LaserGameRoll(self.trapDisable,
                                                    self.trapFire,
                                                    self.sendField,
                                                    self.setGrid)
        elif gameName == "Avoid":
            self.game = LaserGameAvoid.LaserGameAvoid(self.trapDisable,
                                                      self.trapFire,
                                                      self.sendField,
                                                      self.setGrid)
        else:
            self.game = LaserGameMineSweeper.LaserGameMineSweeper(
                self.trapDisable, self.trapFire, self.sendField, self.setGrid)
        self.game.startGrid()
        self.sendField()
        self.sendUpdate("setGridGame", [gameName])
Beispiel #3
0
 def __init__(self, level, entId):
     BattleBlockerAI.BattleBlockerAI.__init__(self, level, entId)
     node = hidden.attachNewNode('DistributedLaserFieldAI')
     NodePath.__init__(self, node)
     if not hasattr(self, 'switchId'):
         self.switchId = 0
     self.gridScale = 1
     self.game = LaserGameRoll.LaserGameRoll(self.trapDisable, self.trapFire, self.sendField, self.setGrid)
     if not hasattr(self, 'gridGame'):
         self.gridGame = 'Roll'
     self.enabled = 1
     self.hasShownSuits = 0
     self.healReady = 1
     self.playedSound = 0
     self.canButton = 1
     self.title = 'MemTag: This is a laserField %s' % random.random()
 def __init__(self, level, entId):
     BattleBlockerAI.BattleBlockerAI.__init__(self, level, entId)
     
     node = hidden.attachNewNode('DistributedLaserFieldAI')
     NodePath.__init__(self, node)
     if not hasattr(self, 'switchId'):
         self.switchId = 0
     self.gridScale = 1
     #print("setting Grid Game Initial Roll")
     self.game = LaserGameRoll.LaserGameRoll(self.trapDisable, self.trapFire, self.sendField, self.setGrid)
     if not hasattr(self, 'gridGame'):
         self.gridGame = "Roll"
     else:
         #print("already has a grid game")
         pass
     #self.setGridGame(self.gridGame)
     self.enabled = 1
     self.hasShownSuits = 0
     self.healReady = 1
     self.playedSound = 0
     self.canButton = 1
     self.title = ("MemTag: This is a laserField %s" % (random.random()))