summaryrefslogtreecommitdiff
path: root/img2map
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-06-03 19:24:29 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-06-03 19:24:29 -0300
commit94bdded9102bc2e2b2e4bded8f180749efda1b72 (patch)
tree1a1dac5472b2797980193ce1439a1ca24f47aabf /img2map
parent022b9bd5f910629ecbf837b38b3cd761c2f703ea (diff)
game: adicionado entity teleporter
Diffstat (limited to 'img2map')
-rwxr-xr-ximg2map9
1 files changed, 9 insertions, 0 deletions
diff --git a/img2map b/img2map
index 5d08db8..128fc63 100755
--- a/img2map
+++ b/img2map
@@ -10,6 +10,7 @@ map_pixels = [ ]
player_position = (0, 0)
ghosts = []
+teles = []
for y in range(height):
linha = []
@@ -25,6 +26,9 @@ for y in range(height):
if (r == 0xFF) and (g == 0x00) and (b == 0x00):
ghosts.append((x, y))
+ if (r == 0xFF) and (g == 0xFF) and (b == 0x00):
+ teles.append((x, y))
+
map_pixels.append(valor)
print(f"int map_width = {width};")
@@ -33,6 +37,11 @@ print(f"float player_x = {player_position[0]};")
print(f"float player_y = {player_position[1]};")
print(f"int ghostcount = {len(ghosts)};")
+print(f"int telessize = {len(teles)};")
+print("struct { float x, y; } teles[] = {")
+print("".join([ f"{{ .x = {str(x[0])}, .y = {str(x[1])} }}, " for x in teles ]))
+print("};")
+
print("float ghostpositions[][2] = {")
print("".join([ f"{{ {str(x[0])}, {str(x[1])} }}, " for x in ghosts ]))
print("};")