Check map bounds when checking collision

This commit is contained in:
Jakub Klupieć 2021-04-19 00:24:42 +02:00
parent 5b469611e6
commit 3463bd0415

View File

@ -23,4 +23,4 @@ class GameMap:
self.entity_layer.remove_entity(pos)
def is_colliding(self, pos):
return self.entity_layer.is_colliding(pos)
return pos[0] < 0 or pos[0] >= self.width or pos[1] < 0 or pos[1] >= self.height or self.entity_layer.is_colliding(pos)