code wiki / _hdl_build / nx_game_loop_gate.nx

nx_game_loop_gate.nx

buildroot/runtime/_hdl_build/nx_game_loop_gate.nx

4012 B102 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic game
docsdependenciesstructsconstsfunctions

about

nx_game_loop_gate.nx -- a COMPLETE game loop on the sovereign 3D engine: a player pursues + collects creatures, win when all collected. Scripted playthrough (player steps toward the nearest creature each frame, captures on contact) rendered as a 3x2 sheet -> sovereign PNG. Mirrors the dungeon/tactics "scripted input -> playthrough -> victory" proof, now in 3D. Win frame gets a green banner. exit 0 = ran. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_voxel_world.nx nx_png.nx nx_game_loop_gate.nx

imports: nx_syscalls.nxnx_voxel_world.nxnx_png.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap world_fb_bytes world_sky mk sys_mmap ↻ render_world world_sky ↻ sys_mmap ↻ build_cam sys_mmap ↻ m4_roty m4_identity f32_of f32_neg fratio f32_div f32_of ↻ m4_rotx m4_identity ↻ f32_neg ↻ f32_neg ↻ m4_mul f32_of ↻ f32_add f32_mul draw_col terrain_h lat sys_mmap ↻ project sys_mmap ↻ f32_sub f32_neg ↻ f32_of ↻ fratio ↻ m4_vec4 f32_of ↻ f32_add ↻ f32_mul ↻

structs

none

consts

9const SW: i64 = 960
10const SH: i64 = 720
11const NC: i64 = 4

functions

13func giabs(a: i64) -> i64 { if a < 0 { return 0 - a } return a }
called by 1: main
14func mk(seed: i64, n: i64, water: i64, maxh: i64, latsp: i64,
called by 1: main calls 1: sys_mmap
22func main() -> i64