Ejemplo n.º 1
0
 def damage(self, damage):
     Character.damage(self, damage)
     if self.hp <= 0 and self.on_play_mode:
         self.kill()
         self.image = self.image_broken
         pg.sprite.Sprite.__init__(self, self.game.characters_sprites)
         pg.time.delay(400)
         pg.event.post(pg.event.Event(PLAYER_GAME_OVER))
Ejemplo n.º 2
0
 def __init__(self, game, x, y, on_play_mode):
     self.on_play_mode = on_play_mode
     self.groups = game.characters_sprites
     pg.sprite.Sprite.__init__(self, self.groups)
     list_images = [
         'images/player_N2.png', 'images/player_E2.png',
         'images/player_S2.png', 'images/player_O2.png',
         'images/player_NE2.png', 'images/player_SE2.png',
         'images/player_SO2.png', 'images/player_NO2.png'
     ]
     self.previus_action = 0
     Character.__init__(self, x, y, list_images, game, game.player,
                        game.feasible_moves_enemy)
     self.image_broken = pg.image.load('images/explosion.png')
Ejemplo n.º 3
0
 def __init__(self, game, x, y, on_play_mode):
     self.groups = game.characters_sprites
     self.on_play_mode = on_play_mode
     pg.sprite.Sprite.__init__(self, self.groups)
     list_images = [
         'images/player_N1.png',
         'images/player_E1.png',
         'images/player_S1.png',
         'images/player_O1.png',
         'images/player_NE1.png',
         'images/player_SE1.png',
         'images/player_SO1.png',
         'images/player_NO1.png'
     ]
     Character.__init__(self, x, y, list_images, game, game.enemy, game.feasible_moves_player, color=LIGHTLIGHTGREY)
Ejemplo n.º 4
0
 def powerup_acquisition(self, n):
     Character.powerup_acquisition(self, n)
     if self.game.on_play_mode:
         self.game.add_player_powerup_visualization(n)
Ejemplo n.º 5
0
 def damage(self, damage):
     Character.damage(self, damage)
     if self.hp <= 0:
         if self.on_play_mode:
             pg.event.post(pg.event.Event(PLAYER_GAME_OVER))
Ejemplo n.º 6
0
 def shoot_fire(self):
     Character.shoot_fire(self)
     if self.on_play_mode and self.nemesi.hp>0:
         pg.event.post(pg.event.Event(ENEMY_TURN_EVENT))
Ejemplo n.º 7
0
 def move(self, dx, dy):
     Character.move(self, dx, dy)
     if self.on_play_mode:
         pg.event.post(pg.event.Event(ENEMY_TURN_EVENT))