nx_wasm_racing.nx
buildroot/runtime/nx_wasm_racing.nx
about
nx_wasm_racing.nx -- BROWSER-PLAYABLE sovereign Racing: BASE-RELATIVE integer core, runs native (-> PNG) AND
in the browser (base = 0 = our sovereign WASM linear memory). NO float, NO JS logic, NO canvas drawing. A
top-down endless dodge racer: hold left/right to steer the car between descending traffic; survive to grow
the distance score; a collision ends the run (shoot/space restarts). init()/tick(input)/render()/score()/
ww()/hh()/fb_off() = the wasm interface (auto-exported). license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_nishi_font_core.nx
imported by: nx_wasm_racing_gate.nx
structs
| none |
consts
| 7 | const O_MAGIC_7919: i64 = 7919 |
| 8 | const W: i64 = 120 |
| 9 | const H: i64 = 180 |
| 10 | const NO: i64 = 5 |
| 11 | const SY: i64 = 156 // player row |
| 12 | const SPEED: i64 = 2 |
| 13 | const O_FB: i64 = 0 // framebuffer W*H i64 at offset 0 |
| 14 | const O_OX: i64 = 172800 // opponent x[16] (W*H*8) |
| 15 | const O_OY: i64 = 172928 // opponent y[16] |
| 16 | const O_ST: i64 = 173056 // scalars[16]: 0=px 1=distance 2=gameover 3=tick |
| 17 | const O_MSK: i64 = 173184 // HUD glyph scratch |
| 18 | const O_STR: i64 = 181376 // HUD string scratch |
functions
| 20 | func rgb(r: i64, g: i64, b: i64) -> i64 { return (r & 255) | ((g & 255) << 8) | ((b & 255) << 16) } called by 1: render_impl |
| 22 | func fillr(base: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64 |
| 35 | func respawn(base: i64, i: i64) -> i64 called by 1: tick_impl |
| 44 | func init_impl(base: i64) -> i64 |
| 54 | func tick_impl(base: i64, input: i64) -> i64 |
| 75 | func car(base: i64, cx: i64, cy: i64, body: i64, top: i64) -> i64 |
| 82 | func render_impl(base: i64) -> i64 |
| 118 | func init() -> i64 { return init_impl(0) } calls 1: init_impl |
| 119 | func tick(input: i64) -> i64 { return tick_impl(0, input) } calls 1: tick_impl |
| 120 | func render() -> i64 { return render_impl(0) } calls 1: render_impl |
| 121 | func score() -> i64 { let st: *i64 = (0 + O_ST) as *i64; return st[1] } |
| 122 | func fb_off() -> i64 { return O_FB } |
| 123 | func ww() -> i64 { return W } |
| 124 | func hh() -> i64 { return H } |