def get_entities_in_front(self, entity): """ Get the entities that are in front of the given entity. :param entity: The entity for which we should get the entities that are in front of it """ pos = Position(entity.get_position()) pos.add(entity.get_move_delta()) return self.get_entities_at(pos)
def can_step(self, agent): position = Position(agent.get_position()) position.add(agent.get_move_delta(1)) return not self.entity_rect_collision( ( position.get_x(), position.get_y(), agent.get_width(), agent.get_height() ) )
def can_step(self, agent): position = Position(agent.get_position()) position.add(agent.get_move_delta(1)) return not self.entity_rect_collision( (position.get_x(), position.get_y(), agent.get_width(), agent.get_height()))