示例#1
0
 def shoot3(self, all_sprites, enemy_bullets):
     bullet = list()
     for i in range(0, 5):
         bullet.append(
             Bullet.Bullet(bullet4_surface, self.rect.centerx - i * 40,
                           self.rect.bottom - i * 20, 0))
     for i in range(1, 5):
         bullet.append(
             Bullet.Bullet(bullet4_surface, self.rect.centerx + i * 40,
                           self.rect.bottom - i * 20, 0))
     all_sprites.add(bullet)
     enemy_bullets.add(bullet)
示例#2
0
 def skill(self, all_sprites, bullets):
     skill = list()
     for i in range(1, 10):
         skill.append(
             Bullet.Bullet(bullet_skill0, self.rect.centerx - i * 20,
                           self.rect.top, 1, -1))
     skill.append(
         Bullet.Bullet(bullet_skill0, self.rect.centerx, self.rect.top, 1))
     for i in range(1, 10):
         skill.append(
             Bullet.Bullet(bullet_skill0, self.rect.centerx + i * 20,
                           self.rect.top, 1, 1))
     all_sprites.add(skill)
     bullets.add(skill)
示例#3
0
 def shoot2(self, all_sprites, enemy_bullets):
     bullet = list()
     for i in range(1, 6):
         bullet.append(
             Bullet.Bullet(bullet2_surface, self.rect.centerx - i * 20,
                           self.rect.bottom, 0, -1))
     bullet.append(
         Bullet.Bullet(bullet2_surface, self.rect.centerx, self.rect.bottom,
                       0))
     for i in range(1, 6):
         bullet.append(
             Bullet.Bullet(bullet2_surface, self.rect.centerx + i * 20,
                           self.rect.bottom, 0, 1))
     all_sprites.add(bullet)
     enemy_bullets.add(bullet)
示例#4
0
 def shoot(self, all_sprites, bullets):
     now = pygame.time.get_ticks()
     if now - self.last_shoot > self.shoot_delay:
         self.last_shoot = now
         bullet = list()
         if self._power == 0:
             bullet.append(
                 Bullet.Bullet(bullet_surface, self.rect.centerx,
                               self.rect.top, 1))
         for i in range(1, self._power + 1):
             bullet.append(
                 Bullet.Bullet(bullet_surface, self.rect.centerx - (i * 10),
                               self.rect.top, 1))
             bullet.append(
                 Bullet.Bullet(bullet_surface, self.rect.centerx + (i * 10),
                               self.rect.top, 1))
         all_sprites.add(bullet)
         bullets.add(bullet)
示例#5
0
 def shoot1(self, all_sprites, enemy_bullets):
     bullet = list()
     bullet.append(
         Bullet.Bullet(bullet1_surface, self.rect.centerx - 60,
                       self.rect.bottom, 0, -2))
     bullet.append(
         Bullet.Bullet(bullet1_surface, self.rect.centerx - 30,
                       self.rect.bottom, 0, -2))
     bullet.append(
         Bullet.Bullet(bullet1_surface, self.rect.centerx, self.rect.bottom,
                       0))
     bullet.append(
         Bullet.Bullet(bullet1_surface, self.rect.centerx + 30,
                       self.rect.bottom, 0, 2))
     bullet.append(
         Bullet.Bullet(bullet1_surface, self.rect.centerx + 60,
                       self.rect.bottom, 0, 2))
     for i in bullet:
         all_sprites.add(i)
         enemy_bullets.add(i)
示例#6
0
 def shoot(self, all_sprites, enemy_bullets):
     bullet = Bullet.Bullet(bullet_surface, self.rect.x, self.rect.bottom,
                            0)
     all_sprites.add(bullet)
     enemy_bullets.add(bullet)
示例#7
0
 def skill1(self, all_sprites, skill):
     bullet = Bullet.Bullet(bullet3_surface, self.rect.centerx,
                            self.rect.bottom, 0, random.randint(-2, 2))
     all_sprites.add(bullet)
     skill.add(bullet)