本文整理汇总了Python中ChaseBallTransitions.inGoalBox方法的典型用法代码示例。如果您正苦于以下问题:Python ChaseBallTransitions.inGoalBox方法的具体用法?Python ChaseBallTransitions.inGoalBox怎么用?Python ChaseBallTransitions.inGoalBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChaseBallTransitions
的用法示例。
在下文中一共展示了ChaseBallTransitions.inGoalBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dribble
# 需要导入模块: import ChaseBallTransitions [as 别名]
# 或者: from ChaseBallTransitions import inGoalBox [as 别名]
def dribble(player):
if transitions.shouldNotDribble(player):
if player.lastDiffState == 'orbitBall':
return player.goNow('approachBall')
return player.goNow('orbitBall')
ball = player.brain.ball
relH = player.decider.normalizeAngle(player.brain.loc.h)
if ball.distance < constants.LINE_UP_X and not (relH > -constants.ORBIT_GOOD_BEARING and
relH < constants.ORBIT_GOOD_BEARING):
player.setWalk(0, 0, 0)
return player.goLater('orbitBall')
if player.brain.ball.vis == True:
if transitions.inGoalBox(player):
player.brain.nav.walk(0.8, 0, 0)
else:
player.brain.nav.goTo(Location(ball.x, ball.y), Navigator.GENERAL_AREA, speeds.SPEED_SIX)
else:
player.brain.nav.walk(0.6, 0, 0)
return player.stay()