diff options
Diffstat (limited to 'scripts/make-jiangnan-art.py')
| -rw-r--r-- | scripts/make-jiangnan-art.py | 77 |
1 files changed, 74 insertions, 3 deletions
diff --git a/scripts/make-jiangnan-art.py b/scripts/make-jiangnan-art.py index 9abb4b8..f537942 100644 --- a/scripts/make-jiangnan-art.py +++ b/scripts/make-jiangnan-art.py @@ -2,7 +2,7 @@ """Deterministic pixel-art atlases for LivingVillage.Desktop. Generates three RGBA PNGs into src/LivingVillage.Desktop/Assets: - jiangnan-world.png 800x32 (25 ground/prop tiles, 32px each) + jiangnan-world.png 1024x32 (32 ground/prop tiles, 32px each) jiangnan-characters.png 3840x48 (5 variants x 4 directions x 6 frames, 32x48 cells) jiangnan-interior.png 392x96 (variable-size bottom-aligned interior cells) @@ -99,7 +99,7 @@ def verify_png(path, expected_w, expected_h): def build_world_atlas(): - c = Canvas(896, 32) + c = Canvas(1024, 32) tile = 32 def slot(index): @@ -547,6 +547,77 @@ def build_world_atlas(): c.rect(x0 + 3, 23, 26, 6, (83, 52, 39, 255)) c.outline(x0, 0, 32, 32) + # --- P26 house facade variant B: projecting eave, lattice window, courtyard gate. + # Same baked-atlas pipeline as every other tile; the renderer only blits these cells. + + # slot(28) 屋檐挑出 (projecting eave): tiled roof band over an exposed wooden lip. + x0 = slot(28) + c.rect(x0, 0, 32, 13, roof_dark) + for x in range(0, 32, 8): + c.rect(x0 + x, 0, 1, 13, roof) + for x in range(4, 32, 8): + c.rect(x0 + x, 0, 1, 13, roof) + c.rect(x0, 2, 32, 1, roof_light) + c.rect(x0, 12, 32, 1, roof) + c.rect(x0, 13, 32, 3, wood) + c.rect(x0, 13, 32, 1, wood_light) + c.rect(x0, 15, 32, 1, wood_dark) + for rx in (3, 10, 17, 24): + c.rect(x0 + rx, 13, 2, 5, wood_dark) + c.rect(x0, 18, 32, 4, (23, 31, 34, 80)) + + # slot(29) 木格栅窗 (lattice window): wooden posts + fine grid muntins. + x0 = slot(29) + c.rect(x0, 0, 32, 32, wall) + c.rect(x0, 0, 32, 3, wood) + c.rect(x0, 0, 32, 1, wood_light) + c.rect(x0, 3, 32, 1, wood_dark) + for post_x in (0, 29): + c.rect(x0 + post_x, 0, 3, 32, wood) + c.rect(x0 + post_x, 0, 1, 32, wood_light) + c.rect(x0 + post_x + 2, 0, 1, 32, wood_dark) + c.rect(x0 + 6, 7, 20, 18, (94, 66, 40, 255)) + c.rect(x0 + 8, 9, 16, 14, (61, 45, 49, 255)) + for lx in (12, 16, 20): + c.rect(x0 + lx, 9, 1, 14, wall_seam) + for ly in (14, 18): + c.rect(x0 + 8, ly, 16, 1, wall_seam) + c.rect(x0 + 6, 7, 20, 1, wood_light) + c.rect(x0 + 3, 28, 26, 4, (128, 128, 126, 255)) + c.rect(x0 + 3, 28, 26, 1, (150, 150, 146, 255)) + + # slot(30) 院门 (courtyard gate): tiled lintel cap, double doors, brass rings. + x0 = slot(30) + c.rect(x0, 0, 32, 32, wall) + c.rect(x0, 0, 32, 3, wood) + c.rect(x0, 0, 32, 1, wood_light) + c.rect(x0, 3, 32, 1, wood_dark) + c.rect(x0 + 3, 4, 26, 4, roof_dark) + c.rect(x0 + 3, 4, 26, 1, roof_light) + c.rect(x0 + 1, 8, 30, 2, roof) + c.rect(x0 + 1, 9, 30, 1, roof_dark) + c.rect(x0 + 5, 10, 22, 18, (94, 66, 40, 255)) + c.rect(x0 + 7, 12, 18, 16, wood) + c.rect(x0 + 7, 12, 18, 1, wood_light) + c.rect(x0 + 15, 12, 2, 16, wood_dark) + c.rect(x0 + 9, 15, 5, 4, wood_dark) + c.rect(x0 + 18, 15, 5, 4, wood_dark) + c.rect(x0 + 13, 20, 2, 2, (196, 158, 74, 255)) + c.rect(x0 + 17, 20, 2, 2, (196, 158, 74, 255)) + c.rect(x0 + 6, 28, 20, 3, (83, 52, 39, 255)) + + # slot(31) 护岸石垒 (revetment): edge-laid cobbles shoring up the riverbank. + x0 = slot(31) + c.rect(x0 + 1, 10, 30, 20, (96, 96, 92, 255)) + revetment = [(2, 11, 8, 5), (11, 10, 9, 6), (21, 11, 8, 5), + (4, 17, 9, 6), (14, 17, 9, 6), (24, 18, 7, 5), + (2, 24, 8, 5), (11, 24, 9, 5), (21, 24, 8, 5)] + for sx, sy, sw, sh in revetment: + c.rect(x0 + sx, sy, sw, sh, stone) + c.rect(x0 + sx, sy, sw, 1, stone_light) + c.rect(x0 + sx, sy + sh - 1, sw, 1, stone_dark) + c.rect(x0 + 1, 29, 30, 2, (96, 96, 92, 255)) + return c @@ -884,7 +955,7 @@ def build_interior_atlas(): def main(): ASSET_DIR.mkdir(parents=True, exist_ok=True) targets = [ - ("jiangnan-world.png", build_world_atlas(), 896, 32), + ("jiangnan-world.png", build_world_atlas(), 1024, 32), ("jiangnan-characters.png", build_character_atlas(), 3840, 48), ("jiangnan-interior.png", build_interior_atlas(), 392, 96), ] |
