summaryrefslogtreecommitdiff
path: root/img2map
diff options
context:
space:
mode:
Diffstat (limited to 'img2map')
-rwxr-xr-ximg2map6
1 files changed, 6 insertions, 0 deletions
diff --git a/img2map b/img2map
index 128fc63..2260fc6 100755
--- a/img2map
+++ b/img2map
@@ -8,6 +8,7 @@ width, height = img.size
map_pixels = [ ]
player_position = (0, 0)
+goal_position = (0, 0)
ghosts = []
teles = []
@@ -23,6 +24,9 @@ for y in range(height):
if (r == 0x00) and (g == 0x00) and (b == 0xFF):
player_position = (x, y)
+ if (r == 0x00) and (g == 0xFF) and (b == 0x00):
+ goal_position = (x, y)
+
if (r == 0xFF) and (g == 0x00) and (b == 0x00):
ghosts.append((x, y))
@@ -49,3 +53,5 @@ print("};")
print("char map_data[] = {")
print("".join([ f"{x}," for x in map_pixels ]))
print("};")
+
+print(f"int goalx = {goal_position[0]}, goaly = {goal_position[1]};")