nx_wasm_adventure.nx
buildroot/runtime/nx_wasm_adventure.nx
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
imports: nx_nishi_font_core.nx
imported by: nx_wasm_adventure_gate.nx
structs
| none |
consts
| 7 | const GW: i64 = 10 |
| 8 | const GH: i64 = 10 |
| 9 | const CELL: i64 = 16 |
| 10 | const W: i64 = 160 // GW*CELL |
| 11 | const H: i64 = 160 |
| 12 | const STEP_CD: i64 = 6 |
| 13 | const O_FB: i64 = 0 // framebuffer W*H i64 |
| 14 | const O_MAP: i64 = 204800 // map[GW*GH] (W*H*8) |
| 15 | const O_ST: i64 = 205600 // scalars[16]: 0=gx 1=gy 2=has_key 3=won 4=cooldown |
| 16 | const O_MSK: i64 = 205728 |
| 17 | const O_STR: i64 = 213920 |
functions
| 19 | func rgb(r: i64, g: i64, b: i64) -> i64 { return (r & 255) | ((g & 255) << 8) | ((b & 255) << 16) } called by 1: render_impl |
| 21 | func fillr(base: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64 called by 1: render_impl |
| 33 | func wall(base: i64, mp: *i64, x: i64, y: i64) -> i64 { mp[y*GW + x] = 1; return 0 } called by 1: init_impl |
| 35 | func init_impl(base: i64) -> i64 |
| 51 | func tick_impl(base: i64, input: i64) -> i64 |
| 70 | func render_impl(base: i64) -> i64 |
| 93 | func init() -> i64 { return init_impl(0) } calls 1: init_impl |
| 94 | func tick(input: i64) -> i64 { return tick_impl(0, input) } calls 1: tick_impl |
| 95 | func render() -> i64 { return render_impl(0) } calls 1: render_impl |
| 96 | func score() -> i64 { let st: *i64 = (0 + O_ST) as *i64; return st[2] } |
| 97 | func fb_off() -> i64 { return O_FB } |
| 98 | func ww() -> i64 { return W } |
| 99 | func hh() -> i64 { return H } |