From 8af1284654a4a5d454a559eca371bf0ac3c79786 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Tue, 31 Aug 2021 23:53:53 +0200 Subject: tech done, building sprites, upgrade on age up, gui --- game/load.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'game/load.cpp') diff --git a/game/load.cpp b/game/load.cpp index 5baae6c..c9c9132 100644 --- a/game/load.cpp +++ b/game/load.cpp @@ -53,6 +53,7 @@ void load_json (Gst &gst) { EntityInfo ent; ent.id = it["id"]; ent.name = it["name"]; + ent.level = it["level"]; ent.range = it["range"]; ent.move = it["move"]; ent.attack = it["attack"]; @@ -88,6 +89,7 @@ void load_json (Gst &gst) { ent.abilities.push_back(index); } ent.spritebounds = vec2 { it["spritebounds"][0], it["spritebounds"][1] }; + if (it.contains("upgrade")) { ent.upgrade = it["upgrade"]; } gst.infos.push_back(ent); } @@ -102,6 +104,43 @@ void load_json (Gst &gst) { for (int i=0; i