diff --git a/assets/.DS_Store b/assets/.DS_Store
index e49b28bfa..b2e30f6b1 100644
Binary files a/assets/.DS_Store and b/assets/.DS_Store differ
diff --git a/assets/DEMO_FAZA1/.DS_Store b/assets/DEMO_FAZA1/.DS_Store
index 61d6972ac..2f32e6309 100644
Binary files a/assets/DEMO_FAZA1/.DS_Store and b/assets/DEMO_FAZA1/.DS_Store differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_0.png b/assets/DEMO_FAZA1/Environment/water_tile_0.png
new file mode 100644
index 000000000..44da3e603
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_0.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_1.png b/assets/DEMO_FAZA1/Environment/water_tile_1.png
new file mode 100644
index 000000000..d9165cc6b
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_1.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_10.png b/assets/DEMO_FAZA1/Environment/water_tile_10.png
new file mode 100644
index 000000000..3d5ce5e26
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_10.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_11.png b/assets/DEMO_FAZA1/Environment/water_tile_11.png
new file mode 100644
index 000000000..0cd2df398
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_11.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_12.png b/assets/DEMO_FAZA1/Environment/water_tile_12.png
new file mode 100644
index 000000000..e4faf0b4d
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_12.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_13.png b/assets/DEMO_FAZA1/Environment/water_tile_13.png
new file mode 100644
index 000000000..fe248e1d6
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_13.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_14.png b/assets/DEMO_FAZA1/Environment/water_tile_14.png
new file mode 100644
index 000000000..cf7145a14
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_14.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_15.png b/assets/DEMO_FAZA1/Environment/water_tile_15.png
new file mode 100644
index 000000000..1909b1608
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_15.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_2.png b/assets/DEMO_FAZA1/Environment/water_tile_2.png
new file mode 100644
index 000000000..63e9c7c43
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_2.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_3.png b/assets/DEMO_FAZA1/Environment/water_tile_3.png
new file mode 100644
index 000000000..c95a2d169
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_3.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_4.png b/assets/DEMO_FAZA1/Environment/water_tile_4.png
new file mode 100644
index 000000000..e6840e772
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_4.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_5.png b/assets/DEMO_FAZA1/Environment/water_tile_5.png
new file mode 100644
index 000000000..c42eba0dc
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_5.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_6.png b/assets/DEMO_FAZA1/Environment/water_tile_6.png
new file mode 100644
index 000000000..d8bba389e
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_6.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_7.png b/assets/DEMO_FAZA1/Environment/water_tile_7.png
new file mode 100644
index 000000000..c01db0b06
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_7.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_8.png b/assets/DEMO_FAZA1/Environment/water_tile_8.png
new file mode 100644
index 000000000..b80c1bfb9
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_8.png differ
diff --git a/assets/DEMO_FAZA1/Environment/water_tile_9.png b/assets/DEMO_FAZA1/Environment/water_tile_9.png
new file mode 100644
index 000000000..8889b27f0
Binary files /dev/null and b/assets/DEMO_FAZA1/Environment/water_tile_9.png differ
diff --git a/assets/maps/clean_assets.tsx b/assets/maps/clean_assets.tsx
new file mode 100644
index 000000000..3645b25a8
--- /dev/null
+++ b/assets/maps/clean_assets.tsx
@@ -0,0 +1,283 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/maps/game_map.tmx b/assets/maps/game_map.tmx
new file mode 100644
index 000000000..00f6a62b1
--- /dev/null
+++ b/assets/maps/game_map.tmx
@@ -0,0 +1,275 @@
+
+
diff --git a/nova farma .tiled-session b/nova farma .tiled-session
index 638a97108..ae7dd7797 100644
--- a/nova farma .tiled-session
+++ b/nova farma .tiled-session
@@ -3,15 +3,28 @@
"height": 4300,
"width": 2
},
- "activeFile": "",
+ "activeFile": "assets/maps/game_map.tmx",
"expandedProjectPaths": [
],
"file.lastUsedOpenFilter": "All Files (*)",
"fileStates": {
+ "assets/maps/clean_assets.tsx": {
+ "scaleInDock": 0.12
+ },
+ "assets/maps/game_map.tmx": {
+ "scale": 0.6519375,
+ "selectedLayer": 1,
+ "viewCenter": {
+ "x": 387.3070654779025,
+ "y": 558.3357300354712
+ }
+ }
},
"openFiles": [
+ "assets/maps/game_map.tmx"
],
"project": "nova farma .tiled-project",
"recentFiles": [
+ "assets/maps/game_map.tmx"
]
}
diff --git a/scripts/generate_tiled_project.py b/scripts/generate_tiled_project.py
index 1a3b8a56f..f0bf1dda9 100644
--- a/scripts/generate_tiled_project.py
+++ b/scripts/generate_tiled_project.py
@@ -1,127 +1,144 @@
-#!/usr/bin/env python3
-"""
-🧱 GENERATE TILED TILESETS (TSX)
-Creates .tsx files for all green-screened assets with transparency configured.
-"""
import os
-from pathlib import Path
-import glob
+import xml.etree.ElementTree as ET
+from xml.dom import minidom
-# Constants
-ASSET_ROOT = "assets"
-TILESET_OUTPUT_DIR = "assets/maps/tilesets"
-TRANSPARENT_COLOR = "00ff00" # Green Screen Color
+# Configuration
+ASSETS_DIR_REL = 'assets/DEMO_FAZA1'
+MAPS_DIR = 'assets/maps'
+TSX_NAME = 'clean_assets.tsx'
+TMX_NAME = 'game_map.tmx'
-# XML Templates
-TSX_HEADER = """
-
-
-"""
+# Layer Structure
+LAYERS = [
+ 'Water',
+ 'Ground_Dirt',
+ 'Decorations',
+ 'Buildings_Solid',
+ 'Foreground_Top',
+]
+OBJECT_LAYERS = ['Collision_Logic']
-TILE_TEMPLATE = """
-
-
-"""
+BASE_DIR = os.getcwd()
-TSX_FOOTER = """
-"""
+def prettify(elem):
+ """Return a pretty-printed XML string for the Element."""
+ rough_string = ET.tostring(elem, 'utf-8')
+ reparsed = minidom.parseString(rough_string)
+ return reparsed.toprettyxml(indent=" ")
-def get_image_size(path):
- # Try to get image dimensions without PIL to avoid dependency if possible,
- # but since we already used PIL for green screen, we can use it here.
- try:
- from PIL import Image
- with Image.open(path) as img:
- return img.width, img.height
- except Exception:
- return 32, 32 # Default fallback
-
-def generate_tileset(directory, name_prefix):
- """Generates a Collection of Images tileset for a directory"""
+def generate_tileset():
+ # Create root
+ # version=1.10 tiledversion=1.10.2 name=clean_assets tilewidth=256 tileheight=256 tilecount=? columns=0
+ # Image Collection means columns=0
- # Find all PNGs
- png_files = sorted(list(Path(directory).rglob("*.png")))
- if not png_files:
- return False
+ # We scan for images to determine max dimensions?
+ # Or just set arbitrary? For image collection, tilewidth/height in header is usually max width?
+
+ root = ET.Element('tileset', {
+ 'version': '1.10',
+ 'tiledversion': '1.11.0',
+ 'name': 'clean_assets',
+ 'tilewidth': '256',
+ 'tileheight': '256',
+ 'tilecount': '0',
+ 'columns': '0'
+ })
+
+ grid = ET.SubElement(root, 'grid', {'orientation': 'orthogonal', 'width': '1', 'height': '1'})
+
+ # Scan files
+ assets_full_path = os.path.join(BASE_DIR, ASSETS_DIR_REL)
+ tile_id = 0
+
+ print(f"Scanning {assets_full_path}...")
+
+ for root_dir, dirs, files in os.walk(assets_full_path):
+ for f in files:
+ if f.lower().endswith('.png') or f.lower().endswith('.jpg'):
+ # Relative path from .tsx directory (assets/maps) to image
+ # .tsx is in assets/maps
+ # Image is in assets/DEMO_FAZA1/...
+
+ # Abs path of image
+ img_abs = os.path.join(root_dir, f)
+
+ # Rel path from BASE
+ # rel_from_base = os.path.relpath(img_abs, BASE_DIR)
+
+ # Rel path from MAPS dir
+ rel_path = os.path.relpath(img_abs, os.path.join(BASE_DIR, MAPS_DIR))
+
+ # Create
+ tile_node = ET.SubElement(root, 'tile', {'id': str(tile_id)})
+
+ #
+ # We technically should read width/height, but Tiled often auto-detects if omitted or 0?
+ # Best to read it if possible, but for speed let's rely on Tiled.
+ # Actually, standard TMX requires image tag.
+
+ ET.SubElement(tile_node, 'image', {
+ 'source': rel_path
+ # 'width': '?', 'height': '?'
+ })
+
+ tile_id += 1
+
+ root.set('tilecount', str(tile_id))
+
+ # Save
+ out_path = os.path.join(BASE_DIR, MAPS_DIR, TSX_NAME)
+ with open(out_path, 'w') as f:
+ f.write(prettify(root))
+ print(f"Generated Tileset: {out_path} with {tile_id} tiles.")
+ return tile_id
- tileset_name = f"{name_prefix}_{os.path.basename(directory)}"
- tsx_content = TSX_HEADER.format(
- name=tileset_name,
- width=32, # Default (doesn't matter much for collection of images)
- height=32,
- count=len(png_files)
- )
-
- print(f"📦 Generating tileset: {tileset_name}.tsx ({len(png_files)} images)")
-
- for i, img_path in enumerate(png_files):
- # Calculate relative path from tileset location to image
- # Tiled needs relative paths
- abs_img = img_path.resolve()
- abs_tileset_dir = Path(TILESET_OUTPUT_DIR).resolve()
+def generate_map(first_gid=1):
+ #