diff options
Diffstat (limited to 'img2map')
| -rwxr-xr-x | img2map | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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]};") |
