def testStopChase(player): player.isChasing = True if goalTran.shouldStopChase(player): print "stop" else: print "not stopping" return player.stay()
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