def update_enemy_start_position(self, delta_position): for x in range(self.width): for y in range(self.height): start_position = Position(x, y) current_position = start_position.add_position(delta_position) if not self.is_position_valid_for_enemy(current_position): self.get_cell(start_position).cannot_be_enemy_start()
def update_enemy_potential_start_position(self, delta_position): for x in range(self.width): for y in range(self.height): start_position = Position(x, y) current_position = start_position.add_position(delta_position) cell = self.get_cell(current_position) if cell: if not self.get_cell( current_position).can_be_enemy_position: self.get_cell(start_position).cannot_be_enemy_start()
def update_enemy_current_position(self, delta_position): for x in range(self.width): for y in range(self.height): current_position = Position(x, y) start_position = current_position.add_position( delta_position.invert_position()) if not self.get_cell(start_position): self.get_cell( current_position).can_be_enemy_position = False else: can_be_position = self.get_cell( start_position).can_be_enemy_start self.get_cell(current_position ).can_be_enemy_position = can_be_position