예제 #1
0
def goaliePosition(player):
    """
    Have the robot navigate to the position reported to it from playbook
    """
    nav = player.brain.nav
    my = player.brain.my
    ball = player.brain.ball
    heading = None

    if player.firstFrame():
        player.isPositioning = True
        player.isChasing = False
        player.isSaving = False
        nav.positionPlaybook()

    if ball.dist >= goalCon.ACTIVE_LOC_THRESH:
        player.brain.tracker.activeLoc()
    else:
        player.brain.tracker.trackBall() 

    if player.brain.nav.isStopped():
        if goalTran.shouldPositionLeft(player):
            player.goNow('goaliePositionLeft')

        elif goalTran.shouldPositionRight(player):
            player.goNow('goaliePositionRight')

    return player.stay()
예제 #2
0
def testShouldPositionRight(player):
    if player.counter % 100 == 0:
        if goalTran.shouldPositionRight(player):
            print "position right"
        elif goalTran.shouldPositionLeft(player):
            print "position left"
        elif goalTran.shouldPositionCenter(player):
            print "postion center"

    return player.stay()