Fixed spawns

This commit is contained in:
theo@manjaro 2021-11-16 10:50:02 +01:00
parent 10120447c1
commit 5b026041cc
1 changed files with 2 additions and 4 deletions

View File

@ -27,8 +27,8 @@ class TilesetRenderer(BaseObject):
self.rects = []
self.semirects = []
self.layers = []
self.spawns = [[self.game.DISPLAY_WIDTH//2,self.game.DISPLAY_HEIGHT//2]] # Valeur par défaut
spawnlists = {"Spawns":self.spawn}
self.spawns = []
spawnlists = {"Spawns":self.spawns}
if "layers" in json.keys() and type(json["layers"]).__name__=="list":
solidlayer = False
for layer in json["layers"]:
@ -37,8 +37,6 @@ class TilesetRenderer(BaseObject):
if layer["name"] == "Solids" and "entities" in layer.keys() : # Je trouve les collisions
solidlayer = layer
elif layer["name"] == "Spawns" and "entities" in layer.keys() : # Je trouve les spawns
if len(layer["entities"])>0:
self.spawns = [] # J'enlève la valeur par défaut
for entity in layer["entities"]:
x,y = entity["x"],entity["y"]
w,h = layer["gridCellWidth"],layer["gridCellHeight"]