Removed removeSprite method
This commit is contained in:
parent
57b95e10df
commit
ce50622b89
@ -10,6 +10,7 @@ from src.entities.Entity import Entity
|
||||
from src.entities.Pickupable import Pickupable
|
||||
from src.entities.Statistics import Statistics
|
||||
|
||||
|
||||
# TODO: Map should determine entities' position
|
||||
class Map:
|
||||
def __init__(self, filename, screen):
|
||||
@ -53,7 +54,9 @@ class Map:
|
||||
if entity["isPickupable"]:
|
||||
actualEntities.append(Pickupable(entity["name"] + ".png",
|
||||
self.tileSize,
|
||||
(entity["position"]["x"] * self.tileSize, entity["position"]["y"] * self.tileSize),
|
||||
# TODO: change to relative coords
|
||||
(entity["position"]["x"] * self.tileSize,
|
||||
entity["position"]["y"] * self.tileSize),
|
||||
Statistics(entity["effect"]["hp"],
|
||||
entity["effect"]["hunger"],
|
||||
entity["effect"]["thirst"],
|
||||
@ -62,6 +65,7 @@ class Map:
|
||||
elif "effect" in entity:
|
||||
actualEntities.append(Interactable(entity["name"] + ".png",
|
||||
self.tileSize,
|
||||
# TODO: Change to relative coords
|
||||
(entity["position"]["x"] * self.tileSize,
|
||||
entity["position"]["y"] * self.tileSize),
|
||||
Statistics(entity["effect"]["hp"],
|
||||
@ -72,7 +76,9 @@ class Map:
|
||||
else:
|
||||
actualEntities.append(Entity(entity["name"] + ".png",
|
||||
self.tileSize,
|
||||
(entity["position"]["x"] * self.tileSize, entity["position"]["y"] * self.tileSize)))
|
||||
# TODO: Change to relative coords
|
||||
(entity["position"]["x"] * self.tileSize,
|
||||
entity["position"]["y"] * self.tileSize)))
|
||||
except KeyError:
|
||||
print("Failed to load entity " + entity)
|
||||
return actualEntities
|
||||
@ -120,7 +126,6 @@ class Map:
|
||||
result = tile
|
||||
return result
|
||||
|
||||
|
||||
def getTileOnCoord(self, coord):
|
||||
result = None
|
||||
for tile in self.terrainTilesList:
|
||||
@ -138,17 +143,6 @@ class Map:
|
||||
if not DONTADD:
|
||||
self.entities.append(entity)
|
||||
|
||||
# Usuwa entity lub teren z mapy
|
||||
def removeSpriteFromMap(self, sprite):
|
||||
if self.collidables.has(sprite):
|
||||
self.collidables.remove(sprite)
|
||||
if sprite in self.entities:
|
||||
self.entities.remove(sprite)
|
||||
if sprite in self.terrainTilesList:
|
||||
self.terrainTilesList.remove(sprite)
|
||||
# TODO: Suspicious?
|
||||
self.screen.removeSprite(sprite)
|
||||
|
||||
# add object to map.collidables list to be collidable
|
||||
def collision(self, x, y):
|
||||
for b in self.collidables:
|
||||
|
Loading…
Reference in New Issue
Block a user