From 36fbdbab62254823debeb6fc44ef9dbcbe7ff784 Mon Sep 17 00:00:00 2001 From: Wirus Date: Sun, 5 Apr 2020 21:18:11 +0200 Subject: [PATCH] Map: removeSpriteFromMap --- src/game/Map.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/game/Map.py b/src/game/Map.py index 82a498f..f0e9a9c 100644 --- a/src/game/Map.py +++ b/src/game/Map.py @@ -38,9 +38,14 @@ class Map: self.screen.draw(entity, Locations.MAP, 0, 0) self.collidables.add(entity) + def removeSpriteFromMap(self, entity): + if self.collidables.has(entity): + self.collidables.remove(entity) + self.screen.removeSprite(entity) + # add object to map.collidables list to be collidable def collision(self, x, y): for b in self.collidables: if b.rect.x == x and b.rect.y == y: return True - return False + return False \ No newline at end of file