def __init__(self): self.group_players = pygame.sprite.Group() #Lista con los jugadores self.group_missil = pygame.sprite.Group() #Lista con todos los misiles self.group_enemy = pygame.sprite.Group() #Lista con todos los enemigos self.group_vidas = pygame.sprite.Group() #Lista con todas las vidas self.background, self.rect = load_png("nightSky.png") self.textos = Texts() self.lastAreaCheck = 0
def __init__(self, imagen, heading, speed, pos): pygame.sprite.Sprite.__init__(self) self.image, self.rect = load_png(imagen) self.rect.topleft = pos self.heading = heading self.speed = speed self.time_passed = 0 self.lastshot = 0 self.hit = False self.hit_time = 1 #how much time is going to last de animation self.was_hit = 0 #how much time the animation has been active self.life = 0 self.impact_damage = 0 self.type = 'ship'
def not_hit(self, imagen): self.hit = False self.was_hit = 0 self.image, rect = load_png(imagen)
def is_hit(self, imagen): #Actualiza el sprite del objeto al estado de 'tocado' self.hit = True self.was_hit = 0 self.image, rect = load_png(imagen)
def not_hit(self): self.hit = False self.was_hit = 0 self.image, rect = load_png("Nucleo.png")
def is_hit(self): self.hit = True self.was_hit = 0 self.image, rect = load_png('Nucleo_hit.png')
def not_hit(self): self.hit = False self.was_hit = 0 self.image, rect = load_png("Bombardero.png")
def is_hit(self): self.hit = True self.was_hit = 0 self.image, rect = load_png('Bombardero_hit.png')
def not_hit(self): self.hit = False self.was_hit = 0 self.image, rect = load_png("Kamikaze.png")
def is_hit(self): self.hit = True self.was_hit = 0 self.image, rect = load_png('Kamikaze_hit.png')
def not_hit(self): self.hit = False self.was_hit = 0 self.image, rect = load_png("Hunter.png")
def is_hit(self): self.hit = True self.was_hit = 0 self.image, rect = load_png('Hunter_hit.png')