2025-11-21 11:51:23 -06:00
|
|
|
(local pxl8 (require :pxl8))
|
|
|
|
|
|
|
|
|
|
(var paused false)
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(var gui nil)
|
|
|
|
|
|
|
|
|
|
(fn init []
|
|
|
|
|
(set gui (pxl8.create_gui)))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
|
|
|
|
(fn show []
|
|
|
|
|
(set paused true)
|
|
|
|
|
(pxl8.set_relative_mouse_mode false)
|
|
|
|
|
(pxl8.center_cursor))
|
|
|
|
|
|
|
|
|
|
(fn hide []
|
|
|
|
|
(set paused false)
|
|
|
|
|
(pxl8.set_relative_mouse_mode true))
|
|
|
|
|
|
|
|
|
|
(fn toggle []
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(when (not gui) (init))
|
2025-11-21 11:51:23 -06:00
|
|
|
(if paused
|
|
|
|
|
(hide)
|
|
|
|
|
(show)))
|
|
|
|
|
|
|
|
|
|
(fn update []
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(when gui
|
|
|
|
|
(let [(mx my) (pxl8.get_mouse_pos)]
|
|
|
|
|
(gui:cursor_move mx my))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(when (pxl8.mouse_pressed 1)
|
|
|
|
|
(gui:cursor_down))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(when (pxl8.mouse_released 1)
|
|
|
|
|
(gui:cursor_up))))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
|
|
|
|
(fn draw []
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(when gui
|
|
|
|
|
(gui:begin_frame)
|
2025-11-21 11:51:23 -06:00
|
|
|
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(pxl8.gui_window 200 100 240 140 "pxl8 demo")
|
2025-11-21 11:51:23 -06:00
|
|
|
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(when (gui:button 1 215 145 210 32 "Resume")
|
|
|
|
|
(hide))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(when (gui:button 2 215 185 210 32 "Quit")
|
|
|
|
|
(pxl8.quit))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(if (gui:is_hovering)
|
|
|
|
|
(pxl8.set_cursor :hand)
|
|
|
|
|
(pxl8.set_cursor :arrow))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
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
2026-01-12 21:46:31 -06:00
|
|
|
(gui:end_frame)))
|
2025-11-21 11:51:23 -06:00
|
|
|
|
|
|
|
|
{:is-paused (fn [] paused)
|
|
|
|
|
:toggle toggle
|
|
|
|
|
:show show
|
|
|
|
|
:hide hide
|
|
|
|
|
:update update
|
|
|
|
|
:draw draw}
|