当前位置: 首页>>代码示例>>Python>>正文


Python ChaseBallTransitions.shouldSpinFindBallAgain方法代码示例

本文整理汇总了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()
开发者ID:AmeenaK,项目名称:nbites,代码行数:36,代码来源:ChaseBallStates.py

示例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()
开发者ID:alawrenc,项目名称:nbites,代码行数:20,代码来源:FindBallStates.py

示例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()
开发者ID:WangHanbin,项目名称:nbites,代码行数:23,代码来源:FindBallStates.py


注:本文中的ChaseBallTransitions.shouldSpinFindBallAgain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。