本文整理汇总了Python中ChaseBallTransitions.shouldSpinFindBallAgain方法的典型用法代码示例。如果您正苦于以下问题:Python ChaseBallTransitions.shouldSpinFindBallAgain方法的具体用法?Python ChaseBallTransitions.shouldSpinFindBallAgain怎么用?Python ChaseBallTransitions.shouldSpinFindBallAgain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChaseBallTransitions
的用法示例。
在下文中一共展示了ChaseBallTransitions.shouldSpinFindBallAgain方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: approachBall
# 需要导入模块: import ChaseBallTransitions [as 别名]
# 或者: from ChaseBallTransitions import shouldSpinFindBallAgain [as 别名]
def approachBall(player):
"""
Once we are aligned with the ball, approach it
"""
if player.firstFrame():
player.brain.nav.chaseBall()
player.hasAlignedOnce = False
player.brain.tracker.trackBall()
# Switch to other states if we should
if player.penaltyKicking and \
player.brain.ball.inOppGoalBox():
return player.goNow('penaltyBallInOppGoalbox')
elif player.brain.play.isRole(GOALIE) and goalTran.dangerousBall(player):
return player.goNow('approachDangerousBall')
elif transitions.shouldDribble(player):
return player.goNow('dribble')
elif transitions.shouldKick(player) or \
transitions.shouldPositionForKick(player):
return player.goNow('decideKick')
elif player.brain.tracker.activeLocOn:
if transitions.shouldScanFindBallActiveLoc(player):
return player.goLater('scanFindBall')
elif transitions.shouldScanFindBall(player):
return player.goLater('scanFindBall')
elif transitions.shouldSpinFindBallAgain(player):
return player.goLater('spinFindBall')
return player.stay()
示例2: walkFindBall
# 需要导入模块: import ChaseBallTransitions [as 别名]
# 或者: from ChaseBallTransitions import shouldSpinFindBallAgain [as 别名]
def walkFindBall(player):
"""
State to walk to find the ball. If we find the ball we chase it.
"""
if transitions.shouldChaseBall(player):
player.stopWalking()
player.brain.tracker.trackBall()
return player.goNow('chase')
if player.brain.nav.isStopped():
player.brain.nav.chaseBall()
player.brain.tracker.trackBall()
if transitions.shouldSpinFindBallAgain(player):
return player.goLater('spinFindBall')
return player.stay()
示例3: walkFindBall
# 需要导入模块: import ChaseBallTransitions [as 别名]
# 或者: from ChaseBallTransitions import shouldSpinFindBallAgain [as 别名]
def walkFindBall(player):
"""
State to walk to find the ball. If we find the ball we chase it.
"""
if player.firstFrame():
player.stopWalking()
# Do a slow pan
player.brain.tracker.repeatWidePanFixedPitch()
if transitions.shouldChaseBall(player):
player.stopWalking()
player.brain.tracker.trackBallFixedPitch()
return player.goNow('findBall')
if player.brain.nav.isStopped():
player.brain.nav.chaseBall()
if transitions.shouldSpinFindBallAgain(player):
return player.goLater('spinFindBall')
return player.stay()