Fixed Critical Assets & Map: Embedded Tilesets in JSON, Created Texture Atlases, Fixed Pathing for Intro/Terrain, Added Audio

This commit is contained in:
2026-01-16 20:38:39 +01:00
parent d0298a6c72
commit 2a6628e79a
41 changed files with 150 additions and 36 deletions

40
expand_tilesets.py Normal file
View File

@@ -0,0 +1,40 @@
import os
from PIL import Image
TERRAIN_PATH = "assets/slike/teren"
def expand_image(filename, copies=4):
path = os.path.join(TERRAIN_PATH, filename)
if not os.path.exists(path):
print(f"Skipping {filename}, not found.")
return
try:
img = Image.open(path)
original_w, original_h = img.size
new_w = original_w * copies
new_h = original_h * copies
new_img = Image.new('RGBA', (new_w, new_h))
# Tile it
for x in range(copies):
for y in range(copies):
new_img.paste(img, (x * original_w, y * original_h))
output_name = filename.replace(".png", "_atlas.png")
output_path = os.path.join(TERRAIN_PATH, output_name)
new_img.save(output_path)
print(f"✅ Created {output_name} ({new_w}x{new_h})")
except Exception as e:
print(f"Error expanding {filename}: {e}")
if __name__ == "__main__":
# Expand main tilesets likely to be used in large maps
expand_image("grass.png", copies=4) # 512*4 = 2048 (covers GIDs up to ~1700)
expand_image("dirt.png", copies=4)
expand_image("stone.png", copies=4)
expand_image("water.png", copies=4)