當前位置: 首頁>>代碼示例>>Python>>正文


Python RepairMincroGame.RepairMincroGame類代碼示例

本文整理匯總了Python中RepairMincroGame.RepairMincroGame的典型用法代碼示例。如果您正苦於以下問題:Python RepairMincroGame類的具體用法?Python RepairMincroGame怎麽用?Python RepairMincroGame使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了RepairMincroGame類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _initVisuals

 def _initVisuals(self):
     RepairMincroGame._initVisuals(self)
     self.model = loader.loadModel('models/gui/pir_m_gui_srp_bracing_main')
     self.background = self.model.find('**/background')
     self.background.reparentTo(self)
     self.background.setZ(0.17499999999999999)
     self.gridParent = self.attachNewNode('gridParent')
     self.grid = []
     for xpos in range(GRID_SIZE):
         col = []
         for ypos in range(GRID_SIZE):
             allWoodSquaresGeom = NodePath('wood_squares')
             for i in range(self.model.find('**/wood_squares').getNumChildren()):
                 self.model.find('**/wood_squares').getChild(i).copyTo(allWoodSquaresGeom)
             
             tempGeom = NodePath('tempGeom')
             self.model.find('**/wood_squares').getChild(0).copyTo(tempGeom)
             selectedOutlineGeom = NodePath('selectedOutlineGeom')
             self.model.find('**/selected').copyTo(selectedOutlineGeom)
             selectedOutlineGeom.setScale(0.90000000000000002)
             piece = RepairGridPiece(name = 'piece%i' % (xpos * GRID_SIZE + ypos), parent = self.gridParent, allWoodSquaresGeom = allWoodSquaresGeom, selectedOutlineGeom = selectedOutlineGeom, scale = (0.90000000000000002, 0.90000000000000002, 0.90000000000000002), pos = (-0.22 + xpos * SPACING, 0.0, -0.029999999999999999 + ypos * SPACING), command = self.onPiecePressed, location = [
                 xpos,
                 ypos], clickSound = None, pressEffect = 0, geom = tempGeom, relief = None)
             col.append(piece)
         
         self.grid.append(col)
     
     self.createGoalPieces()
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:28,代碼來源:RepairBracingGame.py

示例2: destroy

 def destroy(self):
     RepairMincroGame.destroy(self)
     for leakSet in (self.activeLeaks, self.inactiveLeaks, self.patchedLeaks):
         for i in range(len(leakSet)):
             leak = leakSet.pop()
         
     
     del self.activeLeaks
     del self.inactiveLeaks
     del self.patchedLeaks
     for locator in self.locators:
         locator.removeNode()
     
     del self.locators
     self.board.removeNode()
     del self.board
     self.crossHair.removeNode()
     del self.crossHair
     self.bucket.removeNode()
     del self.bucket
     self.bucketIdle.removeNode()
     del self.bucketIdle
     if self.missSeq is not None:
         self.missSeq.finish()
     
     del self.missSeq
     self.missPatch.removeNode()
     del self.missPatch
開發者ID:XamarinDeveloper,項目名稱:Pirates-Online-Source,代碼行數:28,代碼來源:RepairPitchingGame.py

示例3: enterGame

 def enterGame(self):
     RepairMincroGame.enterGame(self)
     taskMgr.add(self.updateTask, 'RepairPitchingGame.updateTask')
     self.bucketPouring = False
     self.accept('mouse1', self.onMouseDown)
     self.accept('mouse1-up', self.onMouseUp)
     self.nextSpawnTime = 0.0
開發者ID:XamarinDeveloper,項目名稱:Pirates-Online-Source,代碼行數:7,代碼來源:RepairPitchingGame.py

示例4: _initVars

 def _initVars(self):
     RepairMincroGame._initVars(self)
     self.circleDirection = GROW
     self.currentMin = 0.0
     self.nailCount = 0
     self.currentNails = []
     self.aim = 1.0
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:7,代碼來源:RepairHammeringGame.py

示例5: setDifficulty

 def setDifficulty(self, difficulty):
     RepairMincroGame.setDifficulty(self, difficulty)
     percent = difficulty / self.repairGame.difficultyMax
     dif = self.config.barnacleCountRange[1] - self.config.barnacleCountRange[0]
     self.barnacleCount = int(math.floor(self.config.barnacleCountRange[0] + dif * percent))
     dif = self.config.barnacleHPScaleRange[1] - self.config.barnacleHPScaleRange[0]
     self.barnacleHPScale = self.config.barnacleHPScaleRange[0] + dif * percent
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:7,代碼來源:RepairCareeningGame.py

示例6: _initVars

 def _initVars(self):
     RepairMincroGame._initVars(self)
     self.boardsPool = { }
     self.currentBoard = None
     self.currentBoardIndex = 0
     self.onDeckBoard = None
     self.onDeckBoardIndex = 0
     self.totalScore = 0.0
     self.hitZone1Penalty = False
     self.hitZone2Penalty = False
     self.hitBoardPenalty = False
     self.moveDiffForSound = 0.0
     self.startPositions = (Point3(0.0, 0.0, 0.0),)
     self.currentStartIndex = 0
     self.lastMousePos = None
     self.board_left = None
     self.board_right = None
     self.cut = None
     self.zone1_right = None
     self.zone1_left = None
     self.zone2_right = None
     self.zone2_left = None
     self.piece1 = None
     self.piece2 = None
     self.lastHitIndex = -1
     self.sawWaypoints = []
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:26,代碼來源:RepairSawingGame.py

示例7: _initAudio

 def _initAudio(self):
     RepairMincroGame._initAudio(self)
     if not self.pumpDownSounds:
         RepairPumpingGame.pumpDownSounds = (loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_DOWN01), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_DOWN02), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_DOWN03))
         RepairPumpingGame.pumpUpSounds = (loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_UP01), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_UP02), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_UP03))
         RepairPumpingGame.pumpGoodSounds = (loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_GOOD01), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_GOOD02), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_GOOD03), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_GOOD04), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_GOOD05), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_GOOD06))
         RepairPumpingGame.pumpBadSounds = (loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_PUMP_BAD),)
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:7,代碼來源:RepairPumpingGame.py

示例8: destroy

 def destroy(self):
     RepairMincroGame.destroy(self)
     taskMgr.remove('SawingGame.updateSawTask')
     self.sawButton.destroy()
     self.sawButton.removeNode()
     del self.sawButton
     if self.currentBoard:
         self.currentBoard.removeNode()
         self.currentBoard = None
     
     if self.onDeckBoard:
         self.onDeckBoard.removeNode()
         self.onDeckBoard = None
     
     self.sawingLine = None
     self.progressDescriptionLabel.destroy()
     self.progressDescriptionLabel = None
     self.progressLabel.destroy()
     self.progressLabel = None
     self.boardDestroyedLabel.destroy()
     self.boardDestroyedLabel = None
     for key in self.boardsPool.keys():
         board = self.boardsPool[key]
         if not board.isEmpty():
             board.removeNode()
             continue
     
     self.boardsPool.clear()
     self.newBoardSequence.clearToInitial()
     del self.newBoardSequence
     self.splitBoardSequence.clearToInitial()
     del self.splitBoardSequence
     self.dropBoardSequence.clearToInitial()
     del self.dropBoardSequence
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:34,代碼來源:RepairSawingGame.py

示例9: enterGame

 def enterGame(self):
     RepairMincroGame.enterGame(self)
     for (xpos, ypos, piece) in self.iterateCoordsAndPieces():
         if not piece.isEmptyPiece():
             piece.setEnabled(True)
             piece.request('Active')
             continue
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:7,代碼來源:RepairBracingGame.py

示例10: destroy

 def destroy(self):
     RepairMincroGame.destroy(self)
     del self.currentNails
     self.board.removeNode()
     self.circle.removeNode()
     for n in self.nails:
         n.removeNode()
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:7,代碼來源:RepairHammeringGame.py

示例11: _initVisuals

 def _initVisuals(self):
     RepairMincroGame._initVisuals(self)
     self.model = loader.loadModel('models/gui/pir_m_gui_srp_hammering_main')
     self.board = self.model.find('**/wood')
     self.board.reparentTo(self)
     self.board.setPos(-0.02, -2.0, 0.080000000000000002)
     self.board.setScale(1.3)
     self.board.setDepthTest(True)
     self.board.setDepthWrite(True)
     self.hammerSwinging = False
     self.nailParent = self.attachNewNode('nailParent')
     self.nails = []
     for i in range(self.config.nailCountRange[1]):
         nailModel = self.model.find('**/nail').copyTo(NodePath())
         nail = RepairNail(name = 'nail%i' % i, parent = self.nailParent, nailModel = nailModel)
         self.nails.append(nail)
     
     self.circle = aspect2d.attachNewNode('circle')
     self.circle.setHpr(0.0, 0.0, 0.0)
     self.circle.setZ(0.20000000000000001)
     self.reticleCursorPerfect = self.model.find('**/reticleCursorPerfect')
     self.reticleCursorPerfect.reparentTo(self.circle)
     self.reticleCursor = self.model.find('**/reticleCursor')
     self.reticleCursor.reparentTo(self.circle)
     self.hammer = self.model.find('**/hammerCursor')
     self.hammer.reparentTo(aspect2d)
     self.circle.stash()
     self.hammer.stash()
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:28,代碼來源:RepairHammeringGame.py

示例12: exitGame

 def exitGame(self):
     RepairMincroGame.exitGame(self)
     self.ignore('mouse1')
     taskMgr.remove('RepairHammerGame.updateTask')
     taskMgr.remove('RepairHammerGame.updateCircleRadiusMin')
     self.circle.stash()
     self.hammer.stash()
     self.repairGame.mousePicker.clearCollisionMask()
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:8,代碼來源:RepairHammeringGame.py

示例13: enterGame

 def enterGame(self):
     RepairMincroGame.enterGame(self)
     self.accept('mouse1', self.onMouseClick)
     self.accept('mouse1-up', self.onMouseUp)
     taskMgr.add(self.updateTask, 'RepairHammerGame.updateTask')
     self.repairGame.mousePicker.setCollisionMask(NAIL_COLLIDE_MASK)
     for n in self.currentNails:
         n.request('Active')
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:8,代碼來源:RepairHammeringGame.py

示例14: exitGame

 def exitGame(self):
     RepairMincroGame.exitGame(self)
     self.sawButton.deactivate()
     self.repairGame.mousePicker.clearCollisionMask()
     taskMgr.remove('SawingGame.updateSawTask')
     self.splitBoardSequence.clearToInitial()
     self.dropBoardSequence.clearToInitial()
     localAvatar.guiMgr._showCursor()
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:8,代碼來源:RepairSawingGame.py

示例15: _initAudio

 def _initAudio(self):
     RepairMincroGame._initAudio(self)
     if not self.hammerComplete:
         RepairHammeringGame.hammerComplete = loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_HAMMER_COMPLETE)
         RepairHammeringGame.weakHammerSounds = (loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_HAMMER_WEAKHIT01), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_HAMMER_WEAKHIT02))
         RepairHammeringGame.normalHammerSounds = (loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_HAMMER_HIT01), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_HAMMER_HIT02), loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_HAMMER_HIT03))
         RepairHammeringGame.perfectHammerSound = loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_HAMMER_PERFECT)
         RepairHammeringGame.failSound = loadSfx(SoundGlobals.SFX_MINIGAME_REPAIR_FAIL)
開發者ID:Puggyblue999,項目名稱:PiratesOfTheCarribeanOnline,代碼行數:8,代碼來源:RepairHammeringGame.py


注:本文中的RepairMincroGame.RepairMincroGame類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。