Added type fields to entities from JSON

This commit is contained in:
Marcin Kostrzewski 2020-05-16 10:02:01 +02:00
parent 454e0ac87d
commit 2318000476

View File

@ -68,7 +68,8 @@ class Map:
Statistics(entity["effect"]["hp"], Statistics(entity["effect"]["hp"],
entity["effect"]["hunger"], entity["effect"]["hunger"],
entity["effect"]["thirst"], entity["effect"]["thirst"],
entity["effect"]["stamina"]))) entity["effect"]["stamina"]),
entity["type"]))
# Creates an interactable object # Creates an interactable object
elif "effect" in entity: elif "effect" in entity:
actualEntities.append(Interactable(entity["name"] + ".png", actualEntities.append(Interactable(entity["name"] + ".png",
@ -77,7 +78,8 @@ class Map:
Statistics(entity["effect"]["hp"], Statistics(entity["effect"]["hp"],
entity["effect"]["hunger"], entity["effect"]["hunger"],
entity["effect"]["thirst"], entity["effect"]["thirst"],
entity["effect"]["stamina"]))) entity["effect"]["stamina"]),
entity["type"]))
# Creates plain entity # Creates plain entity
else: else:
actualEntities.append(Entity(entity["name"] + ".png", actualEntities.append(Entity(entity["name"] + ".png",