Files
Bullosseum/tools/preview_topdown.gd
T
richard 09d4a60f43 Reorganize into role-based folders and consolidate art
Move every script and scene into role-based directories (actors/, systems/, ui/,
levels/, props/) and all raw art under art/ (grouped by role, snake_case,
Extract-Textures GLBs), dropping Blender version-suffix noise. Filenames are
snake_case (PascalCase reserved for class_name) to avoid case-insensitive
filesystem aliasing on the web/macOS targets. Routes the bull's hits through the
typed DamageEvent pipeline and wires the bull's abilities to the Fx library.
Updates CLAUDE.md's folder-layout overview to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCyaJPTHCH9EDthpf4A5Sj
2026-09-08 14:56:22 +03:00

66 lines
2.0 KiB
GDScript

extends SceneTree
## Top-down + angled aerial of the arena with the crowd, plus axis markers, to locate
## the ruined section and any billboards left floating over it.
## godot --script tools/preview_topdown.gd
## Output: tools/preview/top.png (ortho top-down), tools/preview/aerial.png
const OUT := "res://tools/preview"
func _init() -> void:
_run.call_deferred()
func _run() -> void:
DirAccess.make_dir_recursive_absolute(OUT)
var scene := (load("res://levels/game_shell.tscn") as PackedScene).instantiate()
root.add_child(scene)
current_scene = scene
# Axis markers: red pillar at +X (east), green at +Z (south), so directions read.
_marker(scene, Vector3(18, 5, 0), Color(1, 0.2, 0.2))
_marker(scene, Vector3(0, 5, 18), Color(0.2, 1, 0.2))
await create_timer(0.4).timeout
var crowd := scene.get_node_or_null(^"CrowdBillboards") as MultiMeshInstance3D
if crowd != null and crowd.multimesh != null:
print("crowd instances = ", crowd.multimesh.instance_count)
var top := Camera3D.new()
top.projection = Camera3D.PROJECTION_ORTHOGONAL
top.size = 46.0
scene.add_child(top)
top.look_at_from_position(Vector3(0, 60, 0.01), Vector3.ZERO, Vector3(0, 0, -1))
top.current = true
await create_timer(0.2).timeout
_shot("top.png")
var air := Camera3D.new()
air.fov = 60.0
scene.add_child(air)
air.look_at_from_position(Vector3(0, 26, 34), Vector3(0, 3, 0), Vector3.UP)
air.current = true
await create_timer(0.2).timeout
_shot("aerial.png")
quit(0)
func _marker(scene: Node, pos: Vector3, col: Color) -> void:
var m := MeshInstance3D.new()
var box := BoxMesh.new()
box.size = Vector3(1.5, 10.0, 1.5)
var mat := StandardMaterial3D.new()
mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
mat.albedo_color = col
box.material = mat
m.mesh = box
scene.add_child(m)
m.global_position = pos
func _shot(name: String) -> void:
var img := root.get_viewport().get_texture().get_image()
if img != null:
img.save_png(OUT + "/" + name)
print("captured ", name)