From 34766e3709a44b7480ccd2663cb1acb6f39b687b Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Fri, 23 Apr 2021 22:54:28 -0400 Subject: [PATCH] Move game data to one centralized location --- editor/fontedit.fnl | 3 +-- editor/gfxedit.fnl | 10 +++---- editor/init.fnl | 5 ++-- editor/mapedit.fnl | 40 ++++++++++++++++----------- editor/portraitedit.fnl | 3 +-- editor/tileedit.fnl | 3 +-- game/files.fnl | 60 +++++++++++++++++++++++++++++++++++++++++ game/font.json | 1 - game/game.json | 1 + game/map1.json | 1 - game/portraits.json | 1 - game/tiles.fnl | 2 +- game/tiles.json | 1 - main.lua | 2 +- 14 files changed, 98 insertions(+), 35 deletions(-) create mode 100644 game/files.fnl delete mode 100644 game/font.json create mode 100644 game/game.json delete mode 100644 game/map1.json delete mode 100644 game/portraits.json delete mode 100644 game/tiles.json diff --git a/editor/fontedit.fnl b/editor/fontedit.fnl index ccaa5a4..a1d2f18 100644 --- a/editor/fontedit.fnl +++ b/editor/fontedit.fnl @@ -5,7 +5,6 @@ (local FontEditView (TileView:extend)) -(fn FontEditView.spritegen [self] tiledraw.char-to-sprite) (fn FontEditView.tilesize [self] (values 8 8)) (fn FontEditView.tilekeys [self] [:gfx]) (fn FontEditView.map-bitxy [self x y] (values y x)) @@ -14,7 +13,7 @@ (local char (string.char (+ self.itile 0x20 -1))) (renderer.draw_text style.big_font char x y style.text)) (love.graphics.setColor 1 1 1 1)) -(fn FontEditView.filename [self] tiles.fn-font) +(fn FontEditView.resource-key [self] :font) (fn FontEditView.get_name [self] "Font Editor") FontEditView diff --git a/editor/gfxedit.fnl b/editor/gfxedit.fnl index c8d7428..0df5395 100644 --- a/editor/gfxedit.fnl +++ b/editor/gfxedit.fnl @@ -2,6 +2,7 @@ (local tiles (require :game.tiles)) (local tiledraw (require :editor.tiledraw)) (local util (require :lib.util)) +(local files (require :game.files)) (local {: attach-imstate : mouse-inside : activate : active? : button} (util.require :editor.imstate)) (local GraphicsEditView (View:extend)) @@ -11,18 +12,17 @@ (fn GraphicsEditView.new [self] (GraphicsEditView.super.new self) - (set self.tilecache (tiledraw.TileCache (tiles.loadgfx (self:filename)) (self:spritegen))) + (set self.tilecache (files.cache (self:resource-key))) (set self.itile 1) (set self.scrollheight math.huge) (set self.scrollable true) (attach-imstate self)) (fn GraphicsEditView.get_scrollable_size [self] self.scrollheight) -(fn GraphicsEditView.spritegen [self] tiledraw.tile-to-sprite) +(fn GraphicsEditView.resource-key [self] :tiles) (fn GraphicsEditView.tilesize [self] (values 16 16)) (fn GraphicsEditView.tilebytelen [self] (let [(w h) (self:tilesize)] (/ (* w h) 8))) -(fn GraphicsEditView.filename [self] tiles.fn-tiles) -(fn GraphicsEditView.reload [self] - (self.tilecache:load (tiles.loadgfx (self:filename)))) +(fn GraphicsEditView.reload [self] (files.reload)) +(fn GraphicsEditView.save [self] (files.save)) (fn GraphicsEditView.select-rel [self ditile] (when self.itile diff --git a/editor/init.fnl b/editor/init.fnl index 4c5f423..6af9d3c 100644 --- a/editor/init.fnl +++ b/editor/init.fnl @@ -10,7 +10,7 @@ (local common (require :core.common)) (let [commands {}] - (each [_ name (ipairs [:tile :portrait :font :brush])] + (each [_ name (ipairs [:tile :portrait :font :brush :map])] (local cls (require (.. "editor." name "edit"))) (tset commands (.. "honeylisp:" name "-editor") (fn [] (local node (core.root_view:get_active_node)) @@ -18,8 +18,7 @@ (command.add nil commands)) (local fileeditors - {:map {:view MapEditView :filefilter "^game/map%d+%.json"} - :screen {:view ScreenEditView :filefilter "^game/.*%.screen"}}) + {:screen {:view ScreenEditView :filefilter "^game/.*%.screen"}}) (each [type {: view : filefilter} (pairs fileeditors)] (command.add nil diff --git a/editor/mapedit.fnl b/editor/mapedit.fnl index 232bc3d..1a4fe79 100644 --- a/editor/mapedit.fnl +++ b/editor/mapedit.fnl @@ -2,6 +2,7 @@ (local style (require :core.style)) (local util (require :lib.util)) (local lume (require :lib.lume)) +(local files (require :game.files)) (local {: mouse-inside : activate : active? : checkbox : textfield : textbutton : dropdown} (util.require :editor.imstate)) (local {: tilestrip-to-sprite} (util.require :editor.tiledraw)) (local {: encode-yx : encode-itile : decode-itile} (util.require :game.tiles)) @@ -14,11 +15,11 @@ (local tilew (* sprite-scale 14)) (local tileh (* sprite-scale 16)) -(fn MapEditView.new [self filename] +(fn MapEditView.new [self] (MapEditView.super.new self) (set self.sprite-scale sprite-scale) (set self.stripcache {}) - (set self.mapfilename filename) + (set self.ilevel 1) (self:reload)) ; map is stored bottom-to-top @@ -59,6 +60,18 @@ (when (. objects (+ iobjectsrc 1)) (move-object objects (+ iobjectsrc 1) iobjectsrc))) +(fn MapEditView.draw-map-selector [self x y] + (renderer.draw_text style.font "Map" x (+ y (/ style.padding.y 2)) style.text) + (let [options {} + level-count (length files.game.levels) + _ (do (for [i 1 level-count] (tset options i i)) + (table.insert options :New)) + (ilevel yNext) (dropdown self :map-selector self.ilevel options (+ x 50) y 100)] + (when (not= ilevel self.ilevel) + (set self.ilevel (if (= ilevel :New) (+ level-count 1) ilevel)) + (self:load-level)) + (- yNext y))) + (fn MapEditView.linking-obj [self] (. self.level.objects self.iobject-linking)) (fn MapEditView.draw-link-line [self x y iobjectSrc color toMouse?] (local objectSrc (. self.level.objects iobjectSrc)) @@ -90,6 +103,7 @@ (love.graphics.draw sprite x y 0 self.sprite-scale self.sprite-scale)) (fn MapEditView.draw-map-editor [self x y] + (love.graphics.setColor 1 1 1 1) (activate self :map x y (* tilew mapw) (* tileh maph)) (var iobject-over nil) (for [my 1 maph] @@ -179,27 +193,23 @@ (when do-advanced (set object.advanced (not object.advanced))) y)) +(fn MapEditView.load-level [self] + (set self.stripcache {}) + (when (= (. files.game.levels self.ilevel) nil) + (tset files.game.levels self.ilevel {:map (string.rep "\0" (* mapw maph)) :objects []})) + (set self.level (. files.game.levels self.ilevel))) + (fn MapEditView.reload [self] (MapEditView.super.reload self) - (local (loaded level) (pcall #(util.readjson self.mapfilename))) - (set self.level - (match (and loaded (type level)) - false {:map (string.rep "\0" (* mapw maph)) :objects []} - :string {:map (level:fromhex) :objects []} - :table (doto level (tset :map (level.map:fromhex)))))) - -(fn MapEditView.save [self] - (util.writejson self.mapfilename - (doto (lume.clone self.level) - (tset :map (self.level.map:tohex))))) + (self:load-level)) (fn MapEditView.draw [self] (var x (+ self.position.x style.padding.x (- self.scroll.x))) (var y (+ self.position.y style.padding.y (- self.scroll.y))) (self:draw_background style.background) (self:draw_scrollbar) - (love.graphics.setColor 1 1 1 1) (local ytop y) + (set y (+ y (self:draw-map-selector x y) style.padding.y)) (self:draw-map-editor x y) (set y (+ y (* tileh maph) style.padding.y)) (set y (+ y (self:draw-tile-selector x y (- self.size.x (* style.padding.x 2))))) @@ -223,6 +233,6 @@ (set self.scrollheight (- y (+ self.position.y style.padding.y (- self.scroll.y))))) -(fn MapEditView.get_name [self] (.. "Map: " self.mapfilename)) +(fn MapEditView.get_name [self] (.. "Map " self.ilevel)) MapEditView diff --git a/editor/portraitedit.fnl b/editor/portraitedit.fnl index 726d747..c6cd688 100644 --- a/editor/portraitedit.fnl +++ b/editor/portraitedit.fnl @@ -6,10 +6,9 @@ (local PortraitView (TileView:extend)) -(fn PortraitView.spritegen [self] tiledraw.portrait-to-sprite) (fn PortraitView.tilesize [self] (values 32 32)) (fn PortraitView.tilekeys [self] [:gfx]) -(fn PortraitView.filename [self] tiles.fn-portraits) +(fn PortraitView.resource-key [self] :portraits) (fn PortraitView.map-bitxy [self x y] (local quadrant (+ (if (>= x 16) 2 0) (if (>= y 16) 1 0))) (local tilex diff --git a/editor/tileedit.fnl b/editor/tileedit.fnl index 14f4303..519dbc4 100644 --- a/editor/tileedit.fnl +++ b/editor/tileedit.fnl @@ -85,8 +85,6 @@ (fn TileView.update-tile [self newtile] (self.tilecache:update-tile self.itile newtile self.tilekey)) -(fn TileView.save [self] (tiles.savegfx (self:filename) self.tilecache.tiles)) - (fn TileView.draw [self] (self:draw_background style.background) (self:draw_scrollbar) @@ -100,6 +98,7 @@ (set selector-y (+ selector-y selector-h pixel-size))) (set self.scrollheight (- selector-y y))) +(fn TileView.resource-key [self] :tiles) (fn TileView.get_name [self] "Tile Editor") TileView diff --git a/game/files.fnl b/game/files.fnl new file mode 100644 index 0000000..9c40a4b --- /dev/null +++ b/game/files.fnl @@ -0,0 +1,60 @@ +(local util (require :lib.util)) +(local lume (require :lib.lume)) +(local tile (require :game.tiles)) +(local tiledraw (require :editor.tiledraw)) + +(local files (util.hot-table ...)) + +(local filename "game/game.json") + +(fn deserialize [key value] + (match key + (where (or :tiles :portraits :font)) (tile.deserialize value) + :levels (do (set value.map (value.map:fromhex)) value) + _ value)) + +(fn serialize [key value] + (match key + (where (or :tiles :portraits :font)) (tile.serialize value) + :levels (do (set value.map (value.map:tohex)) value) + _ value)) + +(fn files.load [] + (set files.game + (if (util.file-exists filename) + (let [game (util.readjson filename)] + (each [k v (pairs game)] + (tset game k (lume.map v #(deserialize k (lume.clone $1))))) + game) + {:tiles [] :portraits [] :font [] :levels []})) + files.game) + +(fn files.save [] + (let [game {}] + (each [k v (pairs files.game)] + (tset game k (lume.map v #(serialize k (lume.clone $1))))) + (util.writejson filename game))) + +(fn new-cache [game key] + (let [spritegen (match key + :font tiledraw.char-to-sprite + :portraits tiledraw.portrait-to-sprite + _ tiledraw.tile-to-sprite) + gfx (. game key)] + (tiledraw.TileCache gfx spritegen))) + +(fn files.cache [key] + (when (= (?. files :tilecaches key) nil) + (util.nested-tset files [:tilecaches key] (new-cache files.game key))) + (. files.tilecaches key)) + +(fn files.reload [] + (files.load) + (when files.tilecaches + (each [key cache (pairs files.tilecaches)] + (cache:load (. files.game key))))) + +(when (= files.game nil) + (files.load)) + +files.hot diff --git a/game/font.json b/game/font.json deleted file mode 100644 index 9477c40..0000000 --- a/game/font.json +++ /dev/null @@ -1 +0,0 @@ -[{"flags":[],"gfx":"0000000000000000"},{"flags":[],"gfx":"081C1C1C08000800"},{"flags":[],"gfx":"3636241200000000"},{"flags":[],"gfx":"123F1212123F1200"},{"flags":[],"gfx":"083C0A1C281E0800"},{"flags":[],"gfx":"0026160834320000"},{"flags":[],"gfx":"0E1B1B062F1B3600"},{"flags":[],"gfx":"0C0C080400000000"},{"flags":[],"gfx":"180C0606060C1800"},{"flags":[],"gfx":"0C18303030180C00"},{"flags":[],"gfx":"082A1C081C2A0800"},{"flags":[],"gfx":"000C0C3F3F0C0C00"},{"flags":[],"gfx":"000000000C0C0804"},{"flags":[],"gfx":"0000001E1E000000"},{"flags":[],"gfx":"00000000000C0C00"},{"flags":[],"gfx":"002030180C060200"},{"flags":[],"gfx":"1C26263E26261C00"},{"flags":[],"gfx":"181C181818183C00"},{"flags":[],"gfx":"1C2620180C063E00"},{"flags":[],"gfx":"1C26201820261C00"},{"flags":[],"gfx":"2626263C30303000"},{"flags":[],"gfx":"3E061E2020201E00"},{"flags":[],"gfx":"1C26061E26261C00"},{"flags":[],"gfx":"3E2630180C0C0C00"},{"flags":[],"gfx":"1C26261C26261C00"},{"flags":[],"gfx":"1C26263C20201C00"},{"flags":[],"gfx":"000C0C000C0C0000"},{"flags":[],"gfx":"000C0C000C0C0804"},{"flags":[],"gfx":"30180C060C183000"},{"flags":[],"gfx":"00003E003E000000"},{"flags":[],"gfx":"060C1830180C0600"},{"flags":[],"gfx":"1C3630180C000C00"},{"flags":[],"gfx":"1E33212D3D011E00"},{"flags":[],"gfx":"1C3E26263E262600"},{"flags":[],"gfx":"1E26261E26261E00"},{"flags":[],"gfx":"1C26060606261C00"},{"flags":[],"gfx":"1E26262626261E00"},{"flags":[],"gfx":"3E06061E06063E00"},{"flags":[],"gfx":"3E06061E06060600"},{"flags":[],"gfx":"1C26063626263C00"},{"flags":[],"gfx":"2626263E26262600"},{"flags":[],"gfx":"3C18181818183C00"},{"flags":[],"gfx":"3C30303036361C00"},{"flags":[],"gfx":"2626261E26262600"},{"flags":[],"gfx":"0606060606063E00"},{"flags":[],"gfx":"373F2B2B23232300"},{"flags":[],"gfx":"26262E3626262600"},{"flags":[],"gfx":"1C26262626261C00"},{"flags":[],"gfx":"1E26261E06060600"},{"flags":[],"gfx":"1C26262626363C00"},{"flags":[],"gfx":"1E26261E26262600"},{"flags":[],"gfx":"3C26061C20221E00"},{"flags":[],"gfx":"3F0C0C0C0C0C0C00"},{"flags":[],"gfx":"2626262626261C00"},{"flags":[],"gfx":"2626261C1C1C0800"},{"flags":[],"gfx":"2323232B2B2A3600"},{"flags":[],"gfx":"2626261C26262600"},{"flags":[],"gfx":"2626261C18181800"},{"flags":[],"gfx":"3E3E30180C063E00"},{"flags":[],"gfx":"1C0C0C0C0C0C1C00"},{"flags":[],"gfx":"0002060C18302000"},{"flags":[],"gfx":"1C18181818181C00"},{"flags":[],"gfx":"081C260000000000"},{"flags":[],"gfx":"0000000000003E00"},{"flags":[],"gfx":"0C0C100000000000"}] \ No newline at end of file diff --git a/game/game.json b/game/game.json new file mode 100644 index 0000000..343751c --- /dev/null +++ b/game/game.json @@ -0,0 +1 @@ +{"tiles":[{"gfx":"8080808080808080808080808080808080808080808080808080808080808080","word":"","label":"","flags":{"walkable":true}},{"gfx":"8080C0C0C0C0E0F0F8FCE6E6E0B0B0B0808183838383878F9FBFE7E7868C8C8C","word":"","label":"player-frame1","flags":[]},{"gfx":"8080808084CCFCFCFCFCFCF8F0B0B0B080808080E1E1E1F1B99F9F8F8F8C8C8C","word":"","label":"","flags":[]},{"gfx":"D5D5D5858585A5A5A5A5858585D5D5D5AAAAAAA8A8A8A9A9A9A9A8A8A8AAAAAA","word":"","label":"","flags":[]},{"gfx":"8080D4D0D0D0D4D45454D4D4D4D0808080808A8282828A8A8A0A0A8A8A828080","word":"pot","label":"","flags":[]},{"gfx":"8080808080D490948484A48494D080808080808080AA88A8A0A5A5A0A88A8080","word":"","label":"","flags":[]},{"gfx":"8080D4D0D0D0D4D45454D4D4D4D0808080808A8282828A8A8A0A0A8A8A828080","word":"","label":"","flags":[]},{"gfx":"000000A0908884827E0A0A0A0000000000000000201008040785858500000000","word":"","label":"","flags":[]},{"gfx":"000014040414500000000000A888A8800000282020280A010101010195919580","word":"","label":"","flags":[]},{"gfx":"00008C92921C60105010781C0E070300000098A4A41C030504050F1C38706000","word":"","label":"","flags":[]},{"gfx":"000000004040000000D4D4ECECECD480000000000202010101AAAAB6B6B6AA80","word":"","label":"","flags":[]},{"gfx":"0000000000004828282828482800000000000000000004050505050405000000","word":"","label":"","flags":[]}],"levels":[{"loadword":"","map":"000000000000000000000000000000000000000000606060606060606060606060606060606060000060000000000000000000000000000000006000006000000000000000000000000000000000600000600000A00000000000000000004000000060000060000000000000000000000000000000006000006000000000000000000000000000000000600000600000000000000000000000000000000060000060000000000000000080808080800000006000006000000000000000000000000000000000600000606060606060606060606060606060606060000000000000000000000000000000000000000000","player":{"y":4,"x":5},"tickword":"","moveword":"","objects":[{"x":15,"linkentity":"","func":"cat","y":8,"linkword":"","name":""},{"x":5,"linkentity":"","func":"fish","linkword":"","name":"","y":8},{"x":13,"linkentity":"","func":"pot","linkword":"","name":"","y":4},{"x":12,"linkentity":"","func":"suspiciouspot","name":"","linkword":"","y":4},{"x":11,"linkentity":"","func":"pot","name":"","linkword":"","y":4},{"x":14,"linkentity":"","func":"pot","name":"","linkword":"","y":4},{"x":15,"linkentity":"","func":"pot","name":"","linkword":"","y":4}]}],"portraits":[{"gfx":"000000000000000000000000000000000000007C7C7E7E7E7E7E7E7E7E7E7E7E00000000707F7F7F7F7F7F7F7F7F7F7F7E7E7E7E7F7F7F7F7F7F7F7F7F7F7F7F0000000F0F1F1F1F1F1F1F1F1F1F1F1F000000000000000000000000000000001F1F1F1F7F7F7F7F7F7F7F7F7F7F7F7F00000000077F7F7F7F7F7F7F7F7F7F7F","label":"pplayer","flags":[]},{"gfx":"00000000004040606060707070707070000000000000010103037F7F7F7F7F7F707060604000000000000000000000007F7F7F7F7F7F7800004040406060606000000000001018383C3C7F7F7F7F7F7F000000000000000000000000000000007F7F7F3F0F67717C7F7F7F7F7F7F7F7F00007C7E7F7F7F7F7F7F7F7F7F7F7F7F","label":"pcat","flags":[]},{"gfx":"80808080808080808080D5818181858480808080808080808080AA80808080808484848484A4848484A48484848494D0809090D0D4F5D5D5D5D5D480808080AA80808080808080808080D5808080808080808080808080808080AAA0A0A0A888808080808AA8AAAAAA828080808080D588888888888889898888888888888A82","label":"pangryfish","flags":[]}],"font":[{"flags":[],"gfx":"0000000000000000"},{"flags":[],"gfx":"081C1C1C08000800"},{"flags":[],"gfx":"3636241200000000"},{"flags":[],"gfx":"123F1212123F1200"},{"flags":[],"gfx":"083C0A1C281E0800"},{"flags":[],"gfx":"0026160834320000"},{"flags":[],"gfx":"0E1B1B062F1B3600"},{"flags":[],"gfx":"0C0C080400000000"},{"flags":[],"gfx":"180C0606060C1800"},{"flags":[],"gfx":"0C18303030180C00"},{"flags":[],"gfx":"082A1C081C2A0800"},{"flags":[],"gfx":"000C0C3F3F0C0C00"},{"flags":[],"gfx":"000000000C0C0804"},{"flags":[],"gfx":"0000001E1E000000"},{"flags":[],"gfx":"00000000000C0C00"},{"flags":[],"gfx":"002030180C060200"},{"flags":[],"gfx":"1C26263E26261C00"},{"flags":[],"gfx":"181C181818183C00"},{"flags":[],"gfx":"1C2620180C063E00"},{"flags":[],"gfx":"1C26201820261C00"},{"flags":[],"gfx":"2626263C30303000"},{"flags":[],"gfx":"3E061E2020201E00"},{"flags":[],"gfx":"1C26061E26261C00"},{"flags":[],"gfx":"3E2630180C0C0C00"},{"flags":[],"gfx":"1C26261C26261C00"},{"flags":[],"gfx":"1C26263C20201C00"},{"flags":[],"gfx":"000C0C000C0C0000"},{"flags":[],"gfx":"000C0C000C0C0804"},{"flags":[],"gfx":"30180C060C183000"},{"flags":[],"gfx":"00003E003E000000"},{"flags":[],"gfx":"060C1830180C0600"},{"flags":[],"gfx":"1C3630180C000C00"},{"flags":[],"gfx":"1E33212D3D011E00"},{"flags":[],"gfx":"1C3E26263E262600"},{"flags":[],"gfx":"1E26261E26261E00"},{"flags":[],"gfx":"1C26060606261C00"},{"flags":[],"gfx":"1E26262626261E00"},{"flags":[],"gfx":"3E06061E06063E00"},{"flags":[],"gfx":"3E06061E06060600"},{"flags":[],"gfx":"1C26063626263C00"},{"flags":[],"gfx":"2626263E26262600"},{"flags":[],"gfx":"3C18181818183C00"},{"flags":[],"gfx":"3C30303036361C00"},{"flags":[],"gfx":"2626261E26262600"},{"flags":[],"gfx":"0606060606063E00"},{"flags":[],"gfx":"373F2B2B23232300"},{"flags":[],"gfx":"26262E3626262600"},{"flags":[],"gfx":"1C26262626261C00"},{"flags":[],"gfx":"1E26261E06060600"},{"flags":[],"gfx":"1C26262626363C00"},{"flags":[],"gfx":"1E26261E26262600"},{"flags":[],"gfx":"3C26061C20221E00"},{"flags":[],"gfx":"3F0C0C0C0C0C0C00"},{"flags":[],"gfx":"2626262626261C00"},{"flags":[],"gfx":"2626261C1C1C0800"},{"flags":[],"gfx":"2323232B2B2A3600"},{"flags":[],"gfx":"2626261C26262600"},{"flags":[],"gfx":"2626261C18181800"},{"flags":[],"gfx":"3E3E30180C063E00"},{"flags":[],"gfx":"1C0C0C0C0C0C1C00"},{"flags":[],"gfx":"0002060C18302000"},{"flags":[],"gfx":"1C18181818181C00"},{"flags":[],"gfx":"081C260000000000"},{"flags":[],"gfx":"0000000000003E00"},{"flags":[],"gfx":"0C0C100000000000"}]} \ No newline at end of file diff --git a/game/map1.json b/game/map1.json deleted file mode 100644 index d49e10c..0000000 --- a/game/map1.json +++ /dev/null @@ -1 +0,0 @@ -{"loadword":"","map":"000000000000000000000000000000000000000000606060606060606060606060606060606060000060000000000000000000000000000000006000006000000000000000000000000000000000600000600000A00000000000000000004000000060000060000000000000000000000000000000006000006000000000000000000000000000000000600000600000000000000000000000000000000060000060000000000000000080808080800000006000006000000000000000000000000000000000600000606060606060606060606060606060606060000000000000000000000000000000000000000000","player":{"y":4,"x":5},"tickword":"","moveword":"","objects":[{"x":15,"linkentity":"","func":"cat","y":8,"name":"","linkword":""},{"x":5,"linkentity":"","func":"fish","name":"","linkword":"","y":8},{"x":13,"linkentity":"","func":"pot","name":"","linkword":"","y":4},{"x":12,"linkentity":"","func":"suspiciouspot","linkword":"","name":"","y":4},{"x":11,"linkentity":"","func":"pot","linkword":"","name":"","y":4},{"x":14,"linkentity":"","func":"pot","linkword":"","name":"","y":4},{"x":15,"linkentity":"","func":"pot","linkword":"","name":"","y":4}]} \ No newline at end of file diff --git a/game/portraits.json b/game/portraits.json deleted file mode 100644 index d4df77a..0000000 --- a/game/portraits.json +++ /dev/null @@ -1 +0,0 @@ -[{"gfx":"000000000000000000000000000000000000007C7C7E7E7E7E7E7E7E7E7E7E7E00000000707F7F7F7F7F7F7F7F7F7F7F7E7E7E7E7F7F7F7F7F7F7F7F7F7F7F7F0000000F0F1F1F1F1F1F1F1F1F1F1F1F000000000000000000000000000000001F1F1F1F7F7F7F7F7F7F7F7F7F7F7F7F00000000077F7F7F7F7F7F7F7F7F7F7F","label":"pplayer","flags":[]},{"gfx":"00000000004040606060707070707070000000000000010103037F7F7F7F7F7F707060604000000000000000000000007F7F7F7F7F7F7800004040406060606000000000001018383C3C7F7F7F7F7F7F000000000000000000000000000000007F7F7F3F0F67717C7F7F7F7F7F7F7F7F00007C7E7F7F7F7F7F7F7F7F7F7F7F7F","label":"pcat","flags":[]},{"gfx":"80808080808080808080D5818181858480808080808080808080AA80808080808484848484A4848484A48484848494D0809090D0D4F5D5D5D5D5D480808080AA80808080808080808080D5808080808080808080808080808080AAA0A0A0A888808080808AA8AAAAAA828080808080D588888888888889898888888888888A82","label":"pangryfish","flags":[]}] \ No newline at end of file diff --git a/game/tiles.fnl b/game/tiles.fnl index 6372736..9c97975 100644 --- a/game/tiles.fnl +++ b/game/tiles.fnl @@ -82,5 +82,5 @@ (find-itile tiles label (+ itile 1)))) {: loadgfx : savegfx : appendtiles : appendgfx : append-portraitwords : flags : flag-to-bit : find-itile - : fn-tiles : fn-portraits : fn-font : encode-yx : encode-itile : decode-itile} + : fn-tiles : fn-portraits : fn-font : encode-yx : encode-itile : decode-itile : serialize : deserialize} diff --git a/game/tiles.json b/game/tiles.json deleted file mode 100644 index 46357cb..0000000 --- a/game/tiles.json +++ /dev/null @@ -1 +0,0 @@ -[{"gfx":"8080808080808080808080808080808080808080808080808080808080808080","word":"","label":"","flags":{"walkable":true}},{"gfx":"8080C0C0C0C0E0F0F8FCE6E6E0B0B0B0808183838383878F9FBFE7E7868C8C8C","word":"","label":"player-frame1","flags":[]},{"gfx":"8080808084CCFCFCFCFCFCF8F0B0B0B080808080E1E1E1F1B99F9F8F8F8C8C8C","word":"","label":"","flags":[]},{"gfx":"D5D5D5858585A5A5A5A5858585D5D5D5AAAAAAA8A8A8A9A9A9A9A8A8A8AAAAAA","word":"","label":"","flags":[]},{"gfx":"8080D4D0D0D0D4D45454D4D4D4D0808080808A8282828A8A8A0A0A8A8A828080","word":"pot","label":"","flags":[]},{"gfx":"8080808080D490948484A48494D080808080808080AA88A8A0A5A5A0A88A8080","word":"","label":"","flags":[]},{"gfx":"8080D4D0D0D0D4D45454D4D4D4D0808080808A8282828A8A8A0A0A8A8A828080","word":"","label":"","flags":[]},{"gfx":"000000A0908884827E0A0A0A0000000000000000201008040785858500000000","word":"","label":"","flags":[]},{"gfx":"000014040414500000000000A888A8800000282020280A010101010195919580","word":"","label":"","flags":[]},{"gfx":"00008C92921C60105010781C0E070300000098A4A41C030504050F1C38706000","word":"","label":"","flags":[]},{"gfx":"000000004040000000D4D4ECECECD480000000000202010101AAAAB6B6B6AA80","word":"","label":"","flags":[]},{"gfx":"0000000000004828282828482800000000000000000004050505050405000000","word":"","label":"","flags":[]}] \ No newline at end of file diff --git a/main.lua b/main.lua index f2a8305..739f789 100644 --- a/main.lua +++ b/main.lua @@ -1,6 +1,6 @@ -- bootstrap the compiler fennel = require("lib.fennel") -table.insert(package.loaders, fennel.make_searcher({correlate=true})) +table.insert(package.loaders, fennel.make_searcher()) fv = fennel.view pp = function(x) print(fv(x)) end lume = require("lib.lume")