aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-20 22:31:57 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-20 22:31:57 +0100
commitd489b6ef92ae9f61bbceb5f594026a51e71538f2 (patch)
treef0bb53c68f5f8bd6fc4e3df97a5016a8e58224cf /tools
parent8ad4c1aa98144a1799f340a44c80a0e461ced683 (diff)
downloadgold-mine-run-d489b6ef92ae9f61bbceb5f594026a51e71538f2.tar.gz
gold-mine-run-d489b6ef92ae9f61bbceb5f594026a51e71538f2.zip
Add gold support
- added gold layer to the map - the player can collect gold - updates the score - TODO: end of stage
Diffstat (limited to 'tools')
-rwxr-xr-xtools/map.py5
1 files changed, 4 insertions, 1 deletions
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