本文整理汇总了Python中GoalieTransitions.shouldSave方法的典型用法代码示例。如果您正苦于以下问题:Python GoalieTransitions.shouldSave方法的具体用法?Python GoalieTransitions.shouldSave怎么用?Python GoalieTransitions.shouldSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoalieTransitions
的用法示例。
在下文中一共展示了GoalieTransitions.shouldSave方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSaveDecision
# 需要导入模块: import GoalieTransitions [as 别名]
# 或者: from GoalieTransitions import shouldSave [as 别名]
def testSaveDecision(player):
ball = player.brain.ball
if goalTran.shouldSave(player):
return player.goNow('goalieSave')
return player.stay()
示例2: goalieSave
# 需要导入模块: import GoalieTransitions [as 别名]
# 或者: from GoalieTransitions import shouldSave [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()
示例3: goalieSave
# 需要导入模块: import GoalieTransitions [as 别名]
# 或者: from GoalieTransitions import shouldSave [as 别名]
def goalieSave(player):
#going to want it to get in a squat to prepare at somepoint in here
brain = player.brain
if player.firstFrame():
player.isSaving = True
player.isChasing = False
brain.motion.stopHeadMoves()
player.stopWalking()
brain.tracker.trackBall()
if helper.shouldSave(player):
return player.goNow('goaliePickSave')
return player.stay()