def generate_bullets(self, x, y, target, gamma): angle = calculate_angle(x, y, *target) pos_0 = (x + 20 * cos(angle + 0.74*pi), y - 20 * sin(angle + 0.74*pi)) pos_1 = (x + 20 * cos(angle - 0.74*pi), y - 20 * sin(angle - 0.74*pi)) return [(RegularBullet(*pos_0, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body))), (RegularBullet(*pos_1, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)))]
def generate_bullets_auto(x, y, target, gamma): pos_0 = (x + 96 * cos(gamma + 0.25*pi), y - 96 * sin(gamma + 0.25*pi)) pos_1 = (x + 96 * cos(gamma - 0.25*pi), y - 96 * sin(gamma - 0.25*pi)) angle_0 = calculate_angle(*pos_0, *target) angle_1 = calculate_angle(*pos_1, *target) return [RegularBullet(*pos_0, -1, 1.5, angle_0, Body(SMALL_BUL_BODY_1)), RegularBullet(*pos_1, -1, 1.5, angle_1, Body(SMALL_BUL_BODY_1))]
def generate_bullets(self, x, y, target, gamma): angle = calculate_angle(x, y, *target) xo, yo = self.get_reference_point(x, y, angle) pos_0 = xo + 6 * sin(angle), yo + 6 * cos(angle) pos_1 = xo - 6 * sin(angle), yo - 6 * cos(angle) return [RegularBullet(*pos_0, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)), RegularBullet(*pos_1, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body))]
def generate_bullets(self, x, y, target, gamma): angle = calculate_angle(x, y, *target) xo, yo = self.get_reference_point(x, y, angle) pos_0 = (xo, yo) pos_1 = (xo + 53 * cos(angle + 0.48*pi), yo - 53 * sin(angle + 0.48*pi)) pos_2 = (xo + 53 * cos(angle - 0.48*pi), yo - 53 * sin(angle - 0.48*pi)) return [(RegularBullet(*pos_0, -5, 0.75, angle, Body(BIG_BUL_BODY_1))), (RegularBullet(*pos_1, -1, 0.1, angle, Body(SMALL_BUL_BODY_1))), (RegularBullet(*pos_2, -1, 0.1, angle, Body(SMALL_BUL_BODY_1)))]
def generate_bullets(self, x, y, target, gamma): angle = calculate_angle(x, y, *target) xo, yo = self.get_reference_point(x, y, angle) pos_0 = (xo, yo) pos_1 = (xo + 15 * sin(angle - 0.17*pi), yo + 15 * cos(angle - 0.17*pi)) pos_2 = (xo - 15 * sin(angle + 0.17*pi), yo - 15 * cos(angle + 0.17*pi)) return [RegularBullet(*pos_0, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)), RegularBullet(*pos_1, self.bul_dmg, self.bul_vel, angle - 0.17 * pi, Body(self.bul_body)), RegularBullet(*pos_2, self.bul_dmg, self.bul_vel, angle + 0.17 * pi, Body(self.bul_body))]
def generate_bullets(self, x, y, target, gamma): xo, yo = x + 90 * cos(gamma + 0.75*pi), y - 90 * sin(gamma + 0.75*pi) angle_0 = calculate_angle(xo, yo, *target) pos_0 = (xo + 40 * cos(angle_0), yo - 40 * sin(angle_0)) xo, yo = x + 90 * cos(gamma - 0.75*pi), y - 90 * sin(gamma - 0.75*pi) angle_1 = calculate_angle(xo, yo, *target) pos_1 = (xo + 40 * cos(angle_1), yo - 40 * sin(angle_1)) return [RegularBullet(*pos_0, self.bul_dmg, self.bul_vel, angle_0, Body(self.bul_body)), RegularBullet(*pos_1, self.bul_dmg, self.bul_vel, angle_1, Body(self.bul_body))]
def append_bullet(self, x, y, bullets, target): angle = calculate_angle(x, y, *target) xo = x + 23 * cos(angle) yo = y - 23 * sin(angle) bullets.append( RegularBullet(xo, yo, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)))
def append_small_bullet(self, x, y, bullets, target, gamma): xo, yo = x + 30 * cos(gamma), y - 30 * sin(gamma) angle = calculate_angle(xo, yo, *target) xo, yo = xo + 23 * cos(angle), yo - 23 * sin(angle) bullets.append( RegularBullet(xo, yo, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)))
def append_big_bullet(x, y, bullets, gamma, target): x = x - 70 * cos(gamma) y = y + 70 * sin(gamma) angle = calculate_angle(x, y, *target) x += 44 * cos(angle) y -= 44 * sin(angle) bullets.append( RegularBullet(x, y, -15, 0.55, angle, Body(BIG_BUL_BODY_2)))
def append_small_bullet(x, y, bullets, gamma, target): x = x + 12 * cos(gamma) y = y - 12 * sin(gamma) angle = calculate_angle(x, y, *target) x += 24 * cos(angle) y -= 24 * sin(angle) bullets.append( RegularBullet(x, y, -2, 0.55, angle, Body(SMALL_BUL_BODY_2)))
def append_bullet_2(self, x, y, bullets, target, gamma): pos = [x - 35 * cos(gamma), y + 35 * sin(gamma)] angle = calculate_angle(*pos, *target) pos[0] += 35 * cos(angle) pos[1] -= 35 * sin(angle) bullets.append( RegularBullet(*pos, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)))
def generate_bullets(self, x, y, target, gamma): angle = calculate_angle(x, y, *target) coords = self.get_reference_point(x, y, angle) return [ RegularBullet(*coords, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)) ]
def append_bullets(self, x, y, target, bullets, gamma): if self.time >= 0: self.time -= self.cooldown_time for i in range(10): angle = gamma + i * 0.2 * pi xo, yo = x + 38 * cos(angle), y - 38 * sin(angle) bullets.append( RegularBullet(xo, yo, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)))
def generate_bullets(self, x, y, target, gamma): xo, yo = x, y + 210 angle = calculate_angle(xo, yo, *target) coords = (xo + self.radius * cos(angle), yo - self.radius * sin(angle)) return [ RegularBullet(*coords, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body)) ]
def generate_bullets(self, x, y, target, gamma): angle = calculate_angle(x, y, *target) xo, yo = self.get_reference_point(x, y, angle) angles = self.get_bullets_angles(angle) coords = self.get_bullets_coords(xo, yo, angles) bullets = [] for i in range(5): bullets.append(RegularBullet(*coords[i], self.bul_dmg, self.bul_vel, angles[i], Body(self.bul_body))) return bullets
def generate_bullets(self, x, y, target, gamma): angle = calculate_angle(x, y, *target) xo, yo = self.get_reference_point(x, y, angle) sina, cosa = sin(angle), cos(angle) coords = [(xo, yo), (xo + 14*sina, yo + 14*cosa), (xo - 14*sina, yo - 14*cosa), (xo + 28*sina - 4*cosa, yo + 28*cosa + 4*sina), (xo - 28*sina - 4*cosa, yo - 28*cosa + 4*sina)] bullets = [] for pos in coords: bullets.append(RegularBullet(*pos, self.bul_dmg, self.bul_vel, angle, Body(self.bul_body))) return bullets
def append_bullet(self, x, y, bullets): self.target = self.get_target(x, y) bullets.append( RegularBullet(*self.target, -4, 0.8, self.target_angle, Body(self.bul_body)))
def append_bullet(self, x, y, bullets): self.target = self.get_target(x, y) bullets.append( RegularBullet(*self.target, -10, 0.6, self.target_angle, Body(BIG_BUL_BODY_2)))