true 16-bit color... glorious

This commit is contained in:
asrael 2025-11-28 14:41:35 -06:00
parent 3dccce8a81
commit b010f3e471
30 changed files with 679 additions and 652 deletions

View file

@ -3,6 +3,7 @@
(var world nil)
(var auto-run? false)
(var auto-run-cancel-key nil)
(var cam-pitch 0)
(var cam-x 1000)
(var cam-y 64)
@ -77,7 +78,15 @@
(fn update [dt]
(when (pxl8.key_pressed "`")
(set auto-run? (not auto-run?)))
(set auto-run? (not auto-run?))
(when (and auto-run? (pxl8.key_down "w"))
(set auto-run-cancel-key "w")))
(when (and auto-run? (not auto-run-cancel-key) (or (pxl8.key_down "w") (pxl8.key_down "s")))
(set auto-run? false)
(when (pxl8.key_down "s")
(set auto-run-cancel-key "s")))
(when (and auto-run-cancel-key (not (pxl8.key_down auto-run-cancel-key)))
(set auto-run-cancel-key nil))
(when (pxl8.world_is_loaded world)
(let [forward-x (- (math.sin cam-yaw))
@ -94,7 +103,7 @@
(when (or (pxl8.key_down "w") auto-run?)
(set move-forward (+ move-forward 1)))
(when (pxl8.key_down "s")
(when (and (pxl8.key_down "s") (not= auto-run-cancel-key "s"))
(set move-forward (- move-forward 1)))
(when (pxl8.key_down "a")