Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
 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()
         )
     )
Exemple #4
0
 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()))