Beispiel #1
0
    def move(self, m_vector, wall_container):
        super().move(m_vector)

        if Collision.square_square(wall_container.container,
                                   self) is not False:
            super().move([-m_vector[0], -m_vector[1]])
        elif wall_container.check_square_collision(self) is not False:
            super().move([-m_vector[0], -m_vector[1]])
        else:
            # No Collisions
            self.update()
            # Move Distance Lines
            for line in self.distance_lines:
                line.move(m_vector)
Beispiel #2
0
 def check_square_collision(self, test_square):
     """Check if the test square intersects any of the square lines"""
     return Collision.square_square(test_square, self)