Check map bounds when checking collision
This commit is contained in:
parent
5b469611e6
commit
3463bd0415
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user