nx_wasm_diablo.nx
buildroot/runtime/nx_wasm_diablo.nx
about
nx_wasm_diablo.nx -- BROWSER-PLAYABLE sovereign isometric ARPG ("that generation of game"): BASE-RELATIVE
integer core, runs native (-> PNG) AND in the browser (base = 0). Built on nx_gfx_iso: an isometric stone
dungeon with 2.5D walls, a shaded hero, fallen-enemy sprites, and the SIGNATURE dynamic torch lighting that
FOLLOWS the hero. CLICK to move (the click maps a screen point to a destination); walk into a foe to strike
it; grab the gold. NO float, NO JS logic, NO canvas drawing. init()/tick(input)/render()/score()/ww()/hh()/
fb_off()/click(x,y) = the wasm interface. license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_gfx_iso.nxnx_nishi_font_core.nx
imported by: nx_wasm_diablo_gate.nx
structs
| none |
consts
| 9 | const W: i64 = 288 |
| 10 | const H: i64 = 192 |
| 11 | const OX: i64 = 144 // iso origin |
| 12 | const OY: i64 = 22 |
| 13 | const NM: i64 = 4 |
| 14 | const SPD: i64 = 2 |
| 15 | const O_FB: i64 = 0 // framebuffer W*H i64 |
| 16 | const O_MX: i64 = 442368 // monster screen x[8] (W*H*8) |
| 17 | const O_MY: i64 = 442432 |
| 18 | const O_MHP: i64 = 442496 |
| 19 | const O_MA: i64 = 442560 // monster alive[8] |
| 20 | const O_ST: i64 = 442624 // 0=hx 1=hy 2=tx 3=ty 4=gold 5=hp 6=tick 7=atkcd 8=gx 9=gy 10=gtaken 11-15=fx 16=sfx |
| 21 | const O_MSK: i64 = 442816 // (O_ST widened to 24 slots so st[16] = pending sfx event) |
| 22 | const O_STR: i64 = 451008 |
functions
| 24 | func iabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: tick_impl |
| 25 | func isgn(v: i64) -> i64 { if v > 0 { return 1 } if v < 0 { return 0 - 1 } return 0 } called by 1: tick_impl |
| 27 | func init_impl(base: i64) -> i64 |
| 45 | func click_impl(base: i64, x: i64, y: i64) -> i64 |
| 52 | func tick_impl(base: i64, input: i64) -> i64 |
| 86 | func draw_dungeon(base: i64) -> i64 |
| 113 | func hud(base: i64, x: i64, off: i64, val: i64, col: i64) -> i64 |
| 128 | func render_impl(base: i64) -> i64 called by 2: rendermain calls 8: draw_dungeongx_ellipsegx_rgbgx_sprite_humanoidgx_light_radialgx_light_add+2 |
| 169 | func init() -> i64 { return init_impl(0) } calls 1: init_impl |
| 170 | func tick(input: i64) -> i64 { return tick_impl(0, input) } calls 1: tick_impl |
| 171 | func sfx_event() -> i64 { let st: *i64 = (0 + O_ST) as *i64; let e: i64 = st[16]; st[16] = 0; return e } // 1=hit 2=kill 3=coin 4=gameover; cleared on read |
| 172 | func render() -> i64 { return render_impl(0) } calls 1: render_impl |
| 173 | func click(x: i64, y: i64) -> i64 { return click_impl(0, x, y) } calls 1: click_impl |
| 174 | func score() -> i64 { let st: *i64 = (0 + O_ST) as *i64; return st[4] } |
| 175 | func fb_off() -> i64 { return O_FB } |
| 176 | func ww() -> i64 { return W } |
| 177 | func hh() -> i64 { return H } |