Fixed spawns
This commit is contained in:
parent
10120447c1
commit
5b026041cc
@ -27,8 +27,8 @@ class TilesetRenderer(BaseObject):
|
|||||||
self.rects = []
|
self.rects = []
|
||||||
self.semirects = []
|
self.semirects = []
|
||||||
self.layers = []
|
self.layers = []
|
||||||
self.spawns = [[self.game.DISPLAY_WIDTH//2,self.game.DISPLAY_HEIGHT//2]] # Valeur par défaut
|
self.spawns = []
|
||||||
spawnlists = {"Spawns":self.spawn}
|
spawnlists = {"Spawns":self.spawns}
|
||||||
if "layers" in json.keys() and type(json["layers"]).__name__=="list":
|
if "layers" in json.keys() and type(json["layers"]).__name__=="list":
|
||||||
solidlayer = False
|
solidlayer = False
|
||||||
for layer in json["layers"]:
|
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
|
if layer["name"] == "Solids" and "entities" in layer.keys() : # Je trouve les collisions
|
||||||
solidlayer = layer
|
solidlayer = layer
|
||||||
elif layer["name"] == "Spawns" and "entities" in layer.keys() : # Je trouve les spawns
|
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"]:
|
for entity in layer["entities"]:
|
||||||
x,y = entity["x"],entity["y"]
|
x,y = entity["x"],entity["y"]
|
||||||
w,h = layer["gridCellWidth"],layer["gridCellHeight"]
|
w,h = layer["gridCellWidth"],layer["gridCellHeight"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user