本文整理汇总了Python中GoalieTransitions.shouldSaveLeft方法的典型用法代码示例。如果您正苦于以下问题:Python GoalieTransitions.shouldSaveLeft方法的具体用法?Python GoalieTransitions.shouldSaveLeft怎么用?Python GoalieTransitions.shouldSaveLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoalieTransitions
的用法示例。
在下文中一共展示了GoalieTransitions.shouldSaveLeft方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: goalieSave
# 需要导入模块: import GoalieTransitions [as 别名]
# 或者: from GoalieTransitions import shouldSaveLeft [as 别名]
def goalieSave(player):
brain = player.brain
ball = brain.ball
if player.firstFrame():
player.stopWalking()
brain.tracker.trackBall()
player.isSaving = True
if helper.shouldSave(player):
brain.tracker.stopHeadMoves()
brain.fallController.enableFallProtection(False)
if TESTING:
print "Saving because"
print "Ball.relVelX is" + str(ball.loc.relVelX)
print "And Ball.heat is" + str(ball.vis.heat)
if helper.shouldSaveRight(player):
return player.goNow("testSaveRight")
elif helper.shouldSaveLeft(player):
return player.goNow("testSaveLeft")
else:
return player.goNow("testSaveCenter")
else:
if helper.shouldSaveRight(player):
return player.goNow("saveRight")
if helper.shouldSaveLeft(player):
return player.goNow("saveLeft")
else:
return player.goNow("saveCenter")
return player.stay()
示例2: goaliePickSave
# 需要导入模块: import GoalieTransitions [as 别名]
# 或者: from GoalieTransitions import shouldSaveLeft [as 别名]
def goaliePickSave(player):
player.brain.fallController.enableFallProtection(False)
if helper.shouldSaveRight(player):
return player.goNow('saveRight')
elif helper.shouldSaveLeft(player):
return player.goNow('saveLeft')
elif helper.shouldSaveCenter(player):
return player.goNow('saveCenter')
return player.stay()