def add_shot(self, for_player): if len(self.shots) > self.maxShots: return shot_left = bool(random.getrandbits(1)) pos_x = for_player.position_x if shot_left: pos_x += (for_player.image.get_width() / 2) pos_y = for_player.position_y new_shot = Shot(start_pos_x=pos_x, start_pos_y=pos_y) new_shot.speed_y = -self.shotSpeed self.shots.append(new_shot) self.bulledSound.play()