本文整理汇总了Python中arena.Arena.getStartPos方法的典型用法代码示例。如果您正苦于以下问题:Python Arena.getStartPos方法的具体用法?Python Arena.getStartPos怎么用?Python Arena.getStartPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arena.Arena
的用法示例。
在下文中一共展示了Arena.getStartPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main
# 需要导入模块: from arena import Arena [as 别名]
# 或者: from arena.Arena import getStartPos [as 别名]
#.........这里部分代码省略.........
self.credits.hide()
def enterCharSelection(self):
self.accept("CharSelection-Back", self.request, ["Menu"])
self.accept("CharSelection-Start", self.request, ["LevelSelection"])
self.charSelection.show()
def exitCharSelection(self):
self.ignore("CharSelection-Start")
self.ignore("CharSelection-Back")
self.charSelection.hide()
self.selectedChar1 = self.charSelection.selectedCharacter1
self.selectedChar2 = self.charSelection.selectedCharacter2
def enterLevelSelection(self):
self.accept("LevelSelection-Back", self.request, ["CharSelection"])
self.accept("LevelSelection-Start", self.request, ["Game"])
self.levelSelection.show()
def exitLevelSelection(self):
self.ignore("LevelSelection-Start")
self.ignore("LevelSelection-Back")
self.levelSelection.hide()
def enterGame(self):
# main game code should be called here
self.arena = Arena(self.levelSelection.selectedLevel)
self.arena.start()
self.camera.setPos(0, -5, 1.25)
self.player = Player(0, self.selectedChar1, "p1")
self.player2 = Player(1, self.selectedChar2, "p2")
self.player.setEnemy(self.player2.collisionNodeName)
self.player2.setEnemy(self.player.collisionNodeName)
self.player.start(self.arena.getStartPos(1))
self.player2.start(self.arena.getStartPos(2))
self.taskMgr.add(self.updateWorldCam, "world camera update task")
self.accept("gameOver", self.gameOver)
self.hud.show()
def lifeChanged(charId, health):
base.messenger.send(
"hud_setLifeBarValue",
[charId, health])
self.accept("lifeChanged", lifeChanged)
hide_cursor()
if self.fightMusic.status() != AudioSound.PLAYING:
self.fightMusic.play()
if self.menuMusic.status() == AudioSound.PLAYING:
self.menuMusic.stop()
def exitGame(self):
# cleanup for game code
self.taskMgr.remove("world camera update task")
self.player.stop()
self.player2.stop()
del self.player
del self.player2
self.arena.stop()
self.ignore("gameOver")
self.ignore("lifeChanged")
self.hud.hide()
#
# FSM PART END
#
#