refactor: reorganize pxl8 into client/src/ module structure

- core/: main entry, types, logging, I/O, RNG
- asset/: ase loader, cart, save, embed
- gfx/: graphics, animation, atlas, fonts, tilemap, transitions
- sfx/: audio
- script/: lua/fennel runtime, REPL
- hal/: platform abstraction (SDL3)
- world/: BSP, world, procedural gen
- math/: math utilities
- game/: GUI, replay
- lua/: Lua API modules
This commit is contained in:
asrael 2026-01-12 21:46:31 -06:00
parent 272e0bc615
commit 39b604b333
106 changed files with 6078 additions and 3715 deletions

View file

@ -64,16 +64,16 @@
(local step-duration sixteenth)
(fn init []
(set ctx (pxl8.sfx_context_create))
(set ctx (pxl8.create_sfx_context))
(local reverb (pxl8.sfx_reverb_create
(local reverb (pxl8.create_reverb
{:room 0.5 :damping 0.4 :mix 0.35}))
(local compressor (pxl8.sfx_compressor_create
(local compressor (pxl8.create_compressor
{:threshold -18 :ratio 6 :attack 3 :release 100}))
(pxl8.sfx_context_append_node ctx reverb)
(pxl8.sfx_context_append_node ctx compressor)
(ctx:append_node reverb)
(ctx:append_node compressor)
(pxl8.sfx_mixer_attach ctx)
(ctx:attach)
(set melody-params (pxl8.sfx_voice_params
{:waveform pxl8.SFX_WAVE_TRIANGLE
@ -96,7 +96,7 @@
(fn stop []
(set playing false)
(pxl8.sfx_stop_all ctx))
(ctx:stop_all))
(fn update [dt]
(when playing
@ -109,7 +109,7 @@
(local melody-note (. melody-entry 1))
(local melody-dur (. melody-entry 2))
(when (> melody-note 0)
(pxl8.sfx_play_note ctx melody-note melody-params 0.45 melody-dur))
(ctx:play_note melody-note melody-params 0.45 melody-dur))
(local bass-step (math.floor (/ step 2)))
(local bass-idx (+ 1 (% bass-step (length bass))))
@ -117,7 +117,7 @@
(local bass-note (. bass-entry 1))
(local bass-dur (. bass-entry 2))
(when (= (% step 2) 0)
(pxl8.sfx_play_note ctx bass-note bass-params 0.55 bass-dur))
(ctx:play_note bass-note bass-params 0.55 bass-dur))
(set step (+ step 1)))))