honeylisp/game/init.fnl

61 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-11-27 02:34:05 +00:00
(local util (require :lib.util))
(local {: lo : hi : readjson} util)
2020-11-27 04:33:14 +00:00
(local tile (util.reload :game.tiles))
2021-04-25 15:54:12 +00:00
(local {: prg : vm : org : deflevel} (util.reload :game.defs))
(local files (require :game.files))
2020-11-27 04:46:36 +00:00
(local disk (util.reload :game.disk))
2020-11-27 04:33:14 +00:00
(util.reload :game.gfx)
2020-11-29 05:44:23 +00:00
(util.reload :game.footer)
2020-11-27 04:33:14 +00:00
(util.reload :game.map)
(util.reload :game.entity)
2020-12-22 04:24:39 +00:00
(util.reload :game.player)
2021-01-22 03:54:21 +00:00
(util.reload :game.boop)
2020-11-22 03:50:11 +00:00
(tile.appendtiles org.code)
(org.code:append [:align 0x100] :font)
(tile.appendgfx org.code files.game.font)
2021-04-18 04:09:31 +00:00
(tile.append-portraitwords vm)
(vm:var :tick-count)
2021-04-18 04:09:31 +00:00
(vm:word :handle-key :tick :read-key :player-key :hide-footer)
2021-01-24 16:32:49 +00:00
(vm:word :tick :map-specific-tick :tick-count :get 1 :+ :tick-count :set :player-redraw :rnd :drop)
2020-12-15 04:14:35 +00:00
(vm:var :next-level 0)
(vm:word :load-next-level :next-level :get :dup (vm:if [:load-level 0 :next-level :set] [:drop]))
(vm:word :load-level ; level-ptr --
:lit :map-ptr :set :reload-level)
(vm:word :reload-level
:map-player-yx :player-yx :set
:map-specific-load
2020-12-03 01:08:10 +00:00
:full-redraw)
2021-05-06 01:09:40 +00:00
(each [_ flag (ipairs (or files.game.flags []))]
(vm:var (.. :cond-var- flag) vm.false)
(vm:word (.. :cond- flag) (.. :cond-var- flag) :get))
2021-04-25 15:54:12 +00:00
(each [imap _ (ipairs files.game.levels)]
(deflevel imap (.. :map imap)))
2021-04-18 04:09:31 +00:00
2020-11-27 04:33:14 +00:00
(vm.code:append :main
[:jsr :reset]
[:jsr :interpret]
[:vm :hires
:lit :map1 :load-level
(vm:forever
(vm:hotswap-sync :full-redraw)
2020-11-17 20:35:41 +00:00
:interactive-eval-checkpoint
:handle-key
)
:quit])
(disk.append-boot-loader prg)
(print "assembling")
(prg:assemble)
(print "assembled")
(disk.write prg)
2020-11-02 00:39:31 +00:00
prg