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))
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')
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)
def powerup_acquisition(self, n): Character.powerup_acquisition(self, n) if self.game.on_play_mode: self.game.add_player_powerup_visualization(n)
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))
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))
def move(self, dx, dy): Character.move(self, dx, dy) if self.on_play_mode: pg.event.post(pg.event.Event(ENEMY_TURN_EVENT))