wobblyhead hg > minor_monsters
comparison tools/build.py @ 16:30bd10284fd8
added ./game to .hgignore
| author | ark |
|---|---|
| date | 2026-10-19 23:47 +0200 |
| parents | c1c7e4f54bf6 |
| children | fe680946164b |
comparison
equal
deleted
inserted
replaced
| 15:c1c7e4f54bf6 | 16:30bd10284fd8 |
|---|---|
| 504 | 504 |
| 505 # 8. previews | 505 # 8. previews |
| 506 | 506 |
| 507 def step_previews(cfg, maps, force, changed): | 507 def step_previews(cfg, maps, force, changed): |
| 508 outputs = [PREVIEW / f"map{m}.png" for m in range(MAPS)] + [PREVIEW / "towers.png"] | 508 outputs = [PREVIEW / f"map{m}.png" for m in range(MAPS)] + [PREVIEW / "towers.png"] |
| 509 # the tower sheet shows the pivots from game.toml | 509 # the tower sheet shows the pivots, footprint and sprite scale from game.toml |
| 510 if not changed and not stale([CONFIG / "game.toml"], outputs, force): | 510 if not changed and not stale([CONFIG / "game.toml"], outputs, force): |
| 511 print("previews: up to date") | 511 print("previews: up to date") |
| 512 return | 512 return |
| 513 PREVIEW.mkdir(parents=True, exist_ok=True) | 513 PREVIEW.mkdir(parents=True, exist_ok=True) |
| 514 for m, mp in enumerate(maps): | 514 for m, mp in enumerate(maps): |
| 515 preview.map_preview(ART / f"map{m}.png", mp).save(PREVIEW / f"map{m}.png") | 515 preview.map_preview(ART / f"map{m}.png", mp).save(PREVIEW / f"map{m}.png") |
| 516 if len(mp["routes"]) > 1: | 516 if len(mp["routes"]) > 1: |
| 517 preview.route_sheet(ART / f"map{m}.png", mp).save(PREVIEW / f"map{m}_routes.png") | 517 preview.route_sheet(ART / f"map{m}.png", mp).save(PREVIEW / f"map{m}_routes.png") |
| 518 preview.tower_sheet(ASSETS, cfg["art"]["pivot"]).save(PREVIEW / "towers.png") | 518 preview.tower_sheet(ASSETS, cfg["art"]["pivot"], cfg["placement"]["footprint_radius"], |
| 519 cfg["scale"]["sprite"]).save(PREVIEW / "towers.png") | |
| 519 print(f"previews: wrote {PREVIEW.relative_to(ROOT)}/") | 520 print(f"previews: wrote {PREVIEW.relative_to(ROOT)}/") |
| 520 | 521 |
| 521 | 522 |
| 522 def build(force): | 523 def build(force): |
| 523 warnings.clear() | 524 warnings.clear() |
