Esempio n. 1
0
 def exitLoaded(self):
     for i in range(self.MaxPlayers):
         if self._cranes[i]:
             self._cranes[i].requestDelete()
             self._cranes[i] = None
             continue
     DistCogdoLevelGameAI.exitLoaded(self)
Esempio n. 2
0
 def __init__(self, air, interior):
     PM.NodePath.__init__(self, uniqueName("CraneGameAI"))
     DistCogdoLevelGameAI.__init__(self, air, interior)
     self._cranes = [
         None,
     ] * CogdoGameConsts.MaxPlayers
     self._moneyBags = [None] * 8
 def exitLoaded(self):
     for i in xrange(self.MaxPlayers):
         if self._cranes[i]:
             self._cranes[i].requestDelete()
             self._cranes[i] = None
             continue
     DistCogdoLevelGameAI.exitLoaded(self)
Esempio n. 4
0
 def enterLoaded(self):
     DistCogdoLevelGameAI.enterLoaded(self)
     # create the cranes
     for i in range(self.MaxPlayers):
         crane = DistCogdoCraneAI(self.air, self, i)
         crane.generateWithRequired(self.zoneId)
         self._cranes[i] = crane
Esempio n. 5
0
 def exitLoaded(self):
     # destroy the cranes
     for i in range(self.MaxPlayers):
         if self._cranes[i]:
             self._cranes[i].requestDelete()
             self._cranes[i] = None
     DistCogdoLevelGameAI.exitLoaded(self)
Esempio n. 6
0
 def announceGenerate(self):
     DistCogdoLevelGameAI.announceGenerate(self)
     self.finishEvent = self.uniqueName('CogdoCraneGameDone')
     self.gameOverEvent = self.uniqueName('CogdoCraneGameLose')
     for index in xrange(4):
         crane = DistCogdoCraneAI(self.air, self.doId)
         crane.setIndex(index)
         crane.generateWithRequired(self.zoneId)
         self.cranes.append(crane)
Esempio n. 7
0
    def enterGame(self):
        DistCogdoLevelGameAI.enterGame(self)

        # put the players on the cranes
        for i in range(self.getNumPlayers()):
            self._cranes[i].request('Controlled', self.getToonIds()[i])

        # start the game up. Or wait for a while, that's fun too
        self._scheduleGameDone()
Esempio n. 8
0
 def exitLoaded(self):
     # destroy the cranes
     for i in range(len(self._moneyBags)):
         if self._moneyBags[i]:
             self._moneyBags[i].requestDelete()
             self._moneyBags[i] = None
     for i in range(CogdoGameConsts.MaxPlayers):
         if self._cranes[i]:
             self._cranes[i].requestDelete()
             self._cranes[i] = None
     DistCogdoLevelGameAI.exitLoaded(self)
Esempio n. 9
0
    def enterGame(self):
        DistCogdoLevelGameAI.enterGame(self)
        for i in xrange(self.getNumPlayers()):
            self._cranes[i].request('Controlled', self.getToonIds()[i])

        for i in xrange(len(self._moneyBags)):
            if self._moneyBags[i]:
                self._moneyBags[i].request('Initial')

        self._cog = DistCogdoCraneCogAI(self.air, self, self.getDroneCogDNA(), random.randrange(4), globalClock.getFrameTime())
        self._cog.generateWithRequired(self.zoneId)
        self._scheduleGameDone()
Esempio n. 10
0
    def enterGame(self):
        DistCogdoLevelGameAI.enterGame(self)

        # put the players on the cranes
        for i in range(self.getNumPlayers()):
            self._cranes[i].request('Controlled', self.getToonIds()[i])

        for i in range(len(self._moneyBags)):
            if self._moneyBags[i]:
                self._moneyBags[i].request('Initial')

        self._cog = DistCogdoCraneCogAI(self.air, self, self.getDroneCogDNA(),
                                        random.randrange(4),
                                        globalClock.getFrameTime())
        self._cog.generateWithRequired(self.zoneId)

        # start the game up. Or wait for a while, that's fun too
        self._scheduleGameDone()
Esempio n. 11
0
 def enterLoaded(self):
     DistCogdoLevelGameAI.enterLoaded(self)
     # create the cranes
     self.scene = PM.NodePath('scene')
     cn = PM.CollisionNode('walls')
     cs = PM.CollisionSphere(0, 0, 0, 13)
     cn.addSolid(cs)
     cs = PM.CollisionInvSphere(0, 0, 0, 42)
     cn.addSolid(cs)
     self.attachNewNode(cn)
     for i in range(CogdoGameConsts.MaxPlayers):
         crane = DistCogdoCraneAI(self.air, self, i)
         crane.generateWithRequired(self.zoneId)
         self._cranes[i] = crane
     for i in range(len(self._moneyBags)):
         mBag = DistCogdoCraneMoneyBagAI(self.air, self, i)
         mBag.generateWithRequired(self.zoneId)
         self._moneyBags[i] = mBag
Esempio n. 12
0
 def delete(self):
     DistCogdoLevelGameAI.delete(self)
     self.removeNode()
 def __init__(self, air, zoneId, entranceId, avIds):
     DistCogdoLevelGameAI.__init__(self, air, zoneId, entranceId, avIds)
     self.levelSpec = LevelSpec(self.getSpec())
Esempio n. 14
0
 def enterFinish(self):
     DistCogdoLevelGameAI.enterFinish(self)
     self._finishDoneEvent = taskMgr.doMethodLater(
         Consts.FinishDuration.get(), self._finishDoneDL,
         self.uniqueName('boardroomFinishDone'))
    def delete(self):
        DistCogdoLevelGameAI.delete(self)

        for crane in self.cranes:
            crane.requestDelete()
 def generate(self):
     DistCogdoLevelGameAI.generate(self)
 def delete(self):
     DistCogdoLevelGameAI.delete(self)
 def enterLoaded(self):
     DistCogdoLevelGameAI.enterLoaded(self)
     for i in xrange(self.MaxPlayers):
         crane = DistCogdoCraneAI(self.air, self, i)
         crane.generateWithRequired(self.zoneId)
         self._cranes[i] = crane
Esempio n. 19
0
 def __init__(self, air, interior):
     DistCogdoLevelGameAI.__init__(self, air, interior)
    def enterGame(self):
        DistCogdoLevelGameAI.enterGame(self)
        for i in xrange(self.getNumPlayers()):
            self._cranes[i].request('Controlled', self.getToonIds()[i])

        self._scheduleGameDone()
 def __init__(self, air, interior):
     DistCogdoLevelGameAI.__init__(self, air, interior)
     self._cranes = [
         None] * self.MaxPlayers
Esempio n. 22
0
 def __init__(self, air, interior):
     DistCogdoLevelGameAI.__init__(self, air, interior)
     self._cranes = [
         None,
     ] * self.MaxPlayers
 def announceGenerate(self):
     DistCogdoLevelGameAI.announceGenerate(self)
     self.finishEvent = self.uniqueName('CogdoBoardroomGameDone')
     self.gameOverEvent = self.uniqueName('CogdoBoardroomGameLose')
 def enterGame(self):
     DistCogdoLevelGameAI.enterGame(self)
     for i in xrange(self.getNumPlayers()):
         self._cranes[i].request('Controlled', self.getToonIds()[i])
     self._scheduleGameDone()
Esempio n. 25
0
 def enterGame(self):
     DistCogdoLevelGameAI.enterGame(self)
     self._gameDoneEvent = taskMgr.doMethodLater(
         Consts.GameDuration.get(), self._gameDoneDL,
         self.uniqueName('boardroomGameDone'))
Esempio n. 26
0
 def enterFinish(self):
     DistCogdoLevelGameAI.enterFinish(self)
     self._finishDoneEvent = taskMgr.doMethodLater(
         10., self._finishDoneDL, self.uniqueName('boardroomFinishDone'))
 def enterFinish(self):
     DistCogdoLevelGameAI.enterFinish(self)
     self._finishDoneEvent = taskMgr.doMethodLater(10.0, self._finishDoneDL, self.uniqueName('boardroomFinishDone'))