def __init__(self, leftGoal): if leftGoal: posX = - 1.5 else: posX = FIELD_LENGTH + 1.5 posY = FIELD_WIDTH/2 PitchObject.__init__(self, COLOR_GOAL, posX, posY, GRAPH_GOAL_SIZE) PitchObject.update(self)
def __init__(self, playerRole, team, ball): self.team = team self.ball = ball self.perX = playerRole[0] self.perY = playerRole[1] self.defaultPosX = self.perX * FIELD_LENGTH / 2 self.defaultPosY = self.perY * FIELD_WIDTH PitchObject.__init__(self, COLOR_ORANGE, self.defaultPosX, self.defaultPosY, STRAT_HOME_POS_SIZE)
def __init__(self, possessionController, scoreController, leftGoal, rightGoal): PitchObject.__init__(self, COLOR_BALL, self.getStartingPosX(), self.getStartingPosY(), GRAPH_BALL_SIZE) self.image.set_alpha(255) self.possessionController = possessionController self.scoreController = scoreController self.leftGoal = leftGoal self.rightGoal = rightGoal self.possessor = None self.prevPossessor = None self.isLoose = True self.target = None self.shot = False self.outOfPlay = "Kickoff"
def __init__(self, color, posX, posY, size): self.shootingRange = ATTR_SHOOTING_RANGE self.hasBall = False self.isOffsides = False self.covering = [] self.blocking = [] self.marking = None self.blockedBy = [] self.coveredBy = [] self.recovering = 0 # If the player has recently lost the ball, they are recovering and cannot touch the ball self.chargeToBall = False self.maxSpeed = float(ATTR_PLAYER_SPEED) self.acceleration = float(ATTR_PLAYER_ACCEL) PitchObject.__init__(self, color, posX, posY, size)