From d489b6ef92ae9f61bbceb5f594026a51e71538f2 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 20 Jun 2023 22:31:57 +0100 Subject: Add gold support - added gold layer to the map - the player can collect gold - updates the score - TODO: end of stage --- tools/map.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/map.py b/tools/map.py index 2f3479a..d4a23a0 100755 --- a/tools/map.py +++ b/tools/map.py @@ -42,7 +42,10 @@ def main(): map_layer = get_layer(data, "Map") - out = map(lambda x: x - tileset["firstgid"], map_layer["data"]) + out = list(map(lambda x: (x - tileset["firstgid"]) & 0xFF, map_layer["data"])) + + gold_layer = get_layer(data, "Gold") + out.extend(map(lambda x: (x - tileset["firstgid"]) & 0xFF, gold_layer["data"])) # TODO: process map entities -- cgit v1.2.3