code wiki / (root) / nx_wasm_adventure.nx

nx_wasm_adventure.nx

buildroot/runtime/nx_wasm_adventure.nx

4931 B99 linesdepth 1pulls 1 transitivereach 1 importersview sourcekind librarytopic wasm
docsdependenciesstructsconstsfunctions

about

nx_wasm_adventure.nx -- BROWSER-PLAYABLE sovereign Adventure: BASE-RELATIVE integer core, runs native (-> PNG) AND in the browser (base = 0). NO float, NO JS logic, NO canvas drawing. A grid maze: move 4-directionally (a step-cooldown keeps held keys at a sane pace), walls block, collect the key, then the locked door opens (win). init()/tick(input)/render()/score()/ww()/hh()/fb_off() = the wasm interface; input 1=up 2=down 4=left 8=right. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_nishi_font_core.nx nx_wasm_adventure.nx nx_wasm_adventure_gate.nx

imports: nx_nishi_font_core.nx

imported by: nx_wasm_adventure_gate.nx

structs

none

consts

7const GW: i64 = 10
8const GH: i64 = 10
9const CELL: i64 = 16
10const W: i64 = 160 // GW*CELL
11const H: i64 = 160
12const STEP_CD: i64 = 6
13const O_FB: i64 = 0 // framebuffer W*H i64
14const O_MAP: i64 = 204800 // map[GW*GH] (W*H*8)
15const O_ST: i64 = 205600 // scalars[16]: 0=gx 1=gy 2=has_key 3=won 4=cooldown
16const O_MSK: i64 = 205728
17const O_STR: i64 = 213920

functions

19func rgb(r: i64, g: i64, b: i64) -> i64 { return (r & 255) | ((g & 255) << 8) | ((b & 255) << 16) }
called by 1: render_impl
21func fillr(base: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64
called by 1: render_impl
33func wall(base: i64, mp: *i64, x: i64, y: i64) -> i64 { mp[y*GW + x] = 1; return 0 }
called by 1: init_impl
35func init_impl(base: i64) -> i64
called by 2: initmain calls 1: wall
51func tick_impl(base: i64, input: i64) -> i64
called by 2: tickhold
70func render_impl(base: i64) -> i64
called by 2: rendermain calls 2: rgbfillr
93func init() -> i64 { return init_impl(0) }
calls 1: init_impl
94func tick(input: i64) -> i64 { return tick_impl(0, input) }
calls 1: tick_impl
95func render() -> i64 { return render_impl(0) }
calls 1: render_impl
96func score() -> i64 { let st: *i64 = (0 + O_ST) as *i64; return st[2] }
97func fb_off() -> i64 { return O_FB }
98func ww() -> i64 { return W }
99func hh() -> i64 { return H }