Exemplo n.º 1
0
def testChase(player):
    player.isSaving = False
    player.penaltyKicking = False

    if goalTran.shouldChase(player):
        print "chase"
    else:
        print "staying"

    return player.stay()
Exemplo n.º 2
0
def goalieStateChoice(player):
    ball = player.brain.ball

    # for simplicity to start off with we just want the goalie to chase
    # the ball as long as it is close enough and it isnt dangerous

    if player.isChasing:
        if goalTran.shouldStopChase(player):
            return "goaliePosition"
        else:
            return player.currentState

    if player.isPositioning:
        if goalTran.outOfPosition(player):
            return player.currentState
        elif goalTran.shouldChase(player):
            return "goalieChase"

    return player.currentState