summaryrefslogtreecommitdiff
path: root/scripts/make-jiangnan-art.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/make-jiangnan-art.py')
-rw-r--r--scripts/make-jiangnan-art.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/scripts/make-jiangnan-art.py b/scripts/make-jiangnan-art.py
index caf0c01..0c01bd0 100644
--- a/scripts/make-jiangnan-art.py
+++ b/scripts/make-jiangnan-art.py
@@ -3,7 +3,7 @@
Generates three RGBA PNGs into src/LivingVillage.Desktop/Assets:
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-characters.png 5120x48 (5 variants x 4 directions x 8 frames, 32x48 cells)
jiangnan-interior.png 392x96 (variable-size bottom-aligned interior cells)
Cell geometry is mirrored in VillageArt.fs; keep both in sync.
@@ -660,7 +660,8 @@ DIRECTIONS = ["north", "south", "west", "east"]
def draw_character_cell(c, ox, variant, direction, frame):
- # frame: 0 neutral stand, 1 left stride, 2 neutral stand (higher torso bob), 3 right stride
+ # frame: 0 neutral stand, 1 left stride, 2 neutral stand (higher torso bob),
+ # 3 right stride, 4 left-low transition, 5 right-low transition.
robe = variant["robe"]
light = variant["light"]
dark = variant["dark"]
@@ -682,11 +683,21 @@ def draw_character_cell(c, ox, variant, direction, frame):
c.rect(ox + 9, 42, 6, 3, SHOE)
c.rect(ox + 18, 36, 3, 5, dark)
c.rect(ox + 18, 39, 6, 3, SHOE)
- else:
+ elif frame == 3:
c.rect(ox + 18, 36, 4, 7, dark)
c.rect(ox + 18, 42, 6, 3, SHOE)
c.rect(ox + 12, 36, 3, 5, dark)
c.rect(ox + 10, 39, 6, 3, SHOE)
+ elif frame == 4:
+ c.rect(ox + 8, 37, 5, 6, dark)
+ c.rect(ox + 7, 43, 6, 2, SHOE)
+ c.rect(ox + 19, 36, 4, 6, dark)
+ c.rect(ox + 19, 41, 6, 3, SHOE)
+ else:
+ c.rect(ox + 12, 36, 4, 6, dark)
+ c.rect(ox + 11, 41, 6, 3, SHOE)
+ c.rect(ox + 7, 37, 4, 6, dark)
+ c.rect(ox + 6, 43, 6, 2, SHOE)
c.rect(ox + 7, 22, 18, 14, robe)
c.rect(ox + 23, 22, 2, 14, dark)
@@ -837,11 +848,11 @@ def draw_character_idle_cell(c, ox, variant, direction, phase):
def build_character_atlas():
- c = Canvas(3840, 48)
+ c = Canvas(5120, 48)
cell = 0
for variant in VARIANTS:
for direction in DIRECTIONS:
- for frame in range(4):
+ for frame in range(6):
draw_character_cell(c, cell * 32, variant, direction, frame)
cell += 1
for phase in range(2):
@@ -1023,7 +1034,7 @@ def main():
ASSET_DIR.mkdir(parents=True, exist_ok=True)
targets = [
("jiangnan-world.png", build_world_atlas(), 1024, 32),
- ("jiangnan-characters.png", build_character_atlas(), 3840, 48),
+ ("jiangnan-characters.png", build_character_atlas(), 5120, 48),
("jiangnan-interior.png", build_interior_atlas(), 392, 96),
]
for name, canvas, w, h in targets: