def move_bomb(self, e): bomba_ = filter(lambda b: b.id_ == e.id_, self.bombas) bomb = next(bomba_) if colisiones(bomb, self.enemigos.values()) or \ colisiones(bomb, self.walls): self.trigger_stop_bomb.emit(KickBombEvent(None, e.id_)) elif colision(self.player_one, bomb): self.trigger_stop_bomb.emit(KickBombEvent(None, e.id_)) elif self.player_two is not None: if colision(self.player_two, bomb): self.trigger_stop_bomb.emit(KickBombEvent(None, e.id_)) self.trigger_move_label_bomb.emit(e.id_)
def move_enemy(self, e): enemigo = self.enemigos[e.id_] if colisiones(enemigo, self.walls) or colisiones(enemigo, self.bombas): self.trigger_enemy_back.emit(MoveEnemyEvent(e.x, e.y, e.id_)) elif colision(enemigo, self.player_one): self.trigger_enemy_back.emit(MoveEnemyEvent(e.x, e.y, e.id_)) self.trigger_dano_enemigo_1.emit() elif self.player_two is not None: if colision(enemigo, self.player_two): self.trigger_enemy_back.emit(MoveEnemyEvent(e.x, e.y, e.id_)) self.trigger_dano_enemigo_2.emit() else: self.trigger_enemy_label_move.emit(MoveEnemyEvent( e.x, e.y, e.id_)) else: self.trigger_enemy_label_move.emit(MoveEnemyEvent( e.x, e.y, e.id_))
def recibir_dano(self, e): if colision(self, e.espacio): self.impacto()
def recibir_explosion(self, e): if colision(self, e.espacio): self.catched()
def recibir_dano(self, e): if colision(self, e.espacio): self.vida -= 1 self.add_points.emit(e.player)