Implement some level 1 dialogue

This commit is contained in:
Jeremy Penner 2020-11-26 23:46:36 -05:00
parent 3f30ac91c6
commit c8531f9917
5 changed files with 23 additions and 10 deletions

View file

@ -3,6 +3,7 @@
(local lume (require :lib.lume))
(local asm (require :asm.asm))
(local VM (require :asm.vm))
(local tiles (require :game.tiles))
(local prg (asm.new))
(local vm (VM.new prg))
@ -99,5 +100,9 @@
(table.insert result :dismiss-dialog)
result)
{: vm : prg : mapw : maph : mon : org : achar : astr : rot8l : deflevel : with-footer : say}
(local itile
(let [tilelist (tiles.loadgfx tiles.fn-tiles)]
(fn [label] (tiles.find-itile tilelist label))))
{: vm : prg : mapw : maph : mon : org : achar : astr : rot8l : deflevel : with-footer : say : itile}

View file

@ -1,10 +1,7 @@
(local util (require :lib.util))
(local tiles (util.require :game.tiles))
(local {: vm : org} (require :game.defs))
(local {: vm : org : itile} (require :game.defs))
(local {: lo : hi} util)
(local itile
(let [tilelist (tiles.loadgfx tiles.fn-tiles)]
(fn [label] (tiles.find-itile tilelist label))))
; Entity memory layout:
; +0 - yx

View file

@ -1,9 +1,9 @@
(local util (require :lib.util))
(local {: lo : hi : readjson} util)
(local lume (require :lib.lume))
(local {: prg : vm : org : mapw : maph} (require :game.defs))
(local tile (util.reload :game.tiles))
(local {: prg : vm : org : mapw : maph} (util.reload :game.defs))
(util.reload :game.gfx)
(util.reload :game.map)
(util.reload :game.entity)

View file

@ -1,5 +1,16 @@
(local {: deflevel} (require :game.defs))
(local {: deflevel : with-footer : say : itile} (require :game.defs))
(local {: ev} (require :game.entity))
(local level (deflevel "game/map00001.json"))
(local vm level.vm)
(vm:word :exitscanner (with-footer
(say :jaye "IT'S A CARD SCANNER." "IT SHOULD OPEN THIS DOOR.")
(say :jaye "IT'S NOT READING MY CARD" "FOR SOME REASON." "QUAKE MUST'VE DAMAGED IT.")
(say :jaye "NEUT MIGHT BE ABLE TO" "HACK IT...")))
(vm:word :firstdoor
:dup ev.touch := :responder-itile (itile :doorclosed) := :& (vm:when
(with-footer (say :jaye "IT WON'T OPEN!"))
) :door)
level

View file

@ -1 +1 @@
{"map":"212121214121212121212121212141212121212161026161610261616102616161616102616161216143C0C0E2C0C0C0C0C0C06361C0C0C0C0C0612161C0C0A282C0C0C0A2C0C0C081C0C0C0C0C2024161C0C0C0C0C0C0C0C0C2C0A2C1A2C0C0E082612161E2C08282C0C0C0C0A2C0C06161616161616121616161616161C181616161616143C0C0E282612161C0C0C0C0C0C0C0C0C0C0C061C0C0C0C0C0022161E08282A2C0C0C0C0E2C0C081C0C0C0C003612161E2C2C2C0C0C0C0C0C0C0C061C0C0C0C0C06141610303C063E2C0C0C0C0C0C061C0C0C023C061216161616161616161228161616161616161610221","objects":[{"link":2,"y":6,"func":"switch","name":"","linkword":"","x":7},{"x":8,"func":"door","y":6,"linkword":"","name":""},{"x":2,"link":4,"func":"term","linkword":"","name":"","y":4},{"x":17,"link":3,"func":"term","linkword":"","name":"","y":8},{"x":13,"link":6,"func":"switch","linkword":"","name":"","y":8},{"x":13,"func":"door","linkword":"","name":"","y":9}]}
{"map":"212121214121212121212121212141212121212161026161610261616102616161616102616161216143C0C0E2C0C0C0C0C0C06361C0C0C0C0C0612161C0C0A282C0C0C0A2C0C0C081C0C0C0C0C2024161C0C0C0C0C0C0C0C0C2C0A2C1A2C0C0E082612161E2C08282C0C0C0C0A2C0C06161616161616121616161616161C181616161616143C0C0E282612161C0C0C0C0C0C0C0C0C0C0C061C0C0C0C0C0022161E08282A2C0C0C0C0E2C0C081C0C0C0C003612161E2C2C2C0C0C0C0C0C0C0C061C0C0C0C0C06141610303C063E2C0C0C0C0C0C061C0C0C023C061216161616161616161228161616161616161610221","objects":[{"link":2,"x":7,"y":6,"linkword":"","name":"","func":"switch"},{"x":8,"func":"door","name":"","linkword":"","y":6},{"link":4,"y":4,"func":"term","name":"","linkword":"","x":2},{"link":3,"y":8,"func":"term","name":"","linkword":"","x":17},{"link":6,"y":8,"func":"switch","name":"","linkword":"","x":13},{"x":13,"func":"firstdoor","y":9,"linkword":"","name":""},{"x":9,"func":"exitscanner","linkword":"","name":"","y":1}]}