def shoot(self, veloc): if self.tirPrevu: nouveau = self.tirPrevu self.tirPrevu = [] else: nouveau = missile(self.pom.addShooty(veloc)) return nouveau
def planTir(self, centre, tick, instances): self.tirPrevu = missile(self.pom.addShooty(10)) self.tirPrevu.pom.prevision(centre, tick, instances)
flag = False if event.type == pygame.KEYDOWN: if event.key == pygame.K_q: pygame.quit() sys.exit() if event.key == pygame.K_RIGHT or event.key == pygame.K_d: x_move = width / 8 if event.key == pygame.K_LEFT or event.key == pygame.K_a: x_move = -width / 8 if event.key == pygame.K_SPACE: numb += 1 i = bulletclass.Bullet(ship.x + 20, height - 70, pyg_font) bullet.append(i) if event.key == pygame.K_s: numb1 += 1 i = missile.missile(ship.x + 20, height - 70, pyg_font) bullet1.append(i) if event.type == pygame.KEYUP: x_move = 0 screen.blit(background, (0, 0)) for i in range(numb): bullet[i].move(screen) bullet[i].draw(screen) for i in range(numb1): bullet1[i].move(screen) bullet1[i].draw(screen) if finish - start >= levelspawn: