本文整理汇总了Python中arena.Arena.start方法的典型用法代码示例。如果您正苦于以下问题:Python Arena.start方法的具体用法?Python Arena.start怎么用?Python Arena.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arena.Arena
的用法示例。
在下文中一共展示了Arena.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from arena import Arena [as 别名]
# 或者: from arena.Arena import start [as 别名]
print("\n\n", e)
print("Install pillow first: pip3 install pillow\n\n")
for runde in range(0, runden):
# Immer abwechselnd Spieler1 und Spieler2 laufen lassen
if runde % 2 == 0:
arena = Arena(algo1_mod, algo1_name, algo2_mod, algo2_name)
a1 = algo1_stats
a2 = algo2_stats
else:
arena = Arena(algo2_mod, algo2_name, algo1_mod, algo1_name)
a1 = algo2_stats
a2 = algo1_stats
arena.start()
punkte1 = []
punkte2 = []
print()
print("Runde: ", runde)
while arena.laueft_noch():
p1, p2 = arena.aktualisiere()
punkte1.extend(p1)
punkte2.extend(p2)
# print("Punkte: %s = %d, %s = %d" % (a1["name"], len(punkte1), a2["name"], len(punkte2)))
time.sleep(.01)
if img_support:
示例2: Main
# 需要导入模块: from arena import Arena [as 别名]
# 或者: from arena.Arena import start [as 别名]
#.........这里部分代码省略.........
self.accept("Credits-Back", self.request, ["Menu"])
self.koScreen.hide()
self.credits.show()
def exitCredits(self):
self.ignore("Credits-Back")
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()