2021-03-07 16:55:50 +00:00
|
|
|
(local dim (require :game.dim))
|
|
|
|
(local util (require :lib.util))
|
2021-04-11 03:39:42 +00:00
|
|
|
(local {: defmethod} (util.require :lib.multimethod))
|
|
|
|
(local {: drawtile} (util.require :game.tilemap))
|
2021-03-07 16:55:50 +00:00
|
|
|
|
2021-03-30 23:24:52 +00:00
|
|
|
(local tileset (util.hot-table ...))
|
2021-03-07 16:55:50 +00:00
|
|
|
(fn rect [x y color]
|
|
|
|
(love.graphics.setColor (table.unpack color))
|
|
|
|
(love.graphics.rectangle :fill
|
|
|
|
(- x (/ dim.tilesize 2))
|
|
|
|
(- y (/ dim.tilesize 2))
|
|
|
|
dim.tilesize
|
|
|
|
dim.tilesize))
|
|
|
|
|
2022-04-24 23:39:15 +00:00
|
|
|
(defmethod drawtile :wall (fn [tile x y] (rect x y [0.7 0.7 0.7])))
|
|
|
|
(defmethod drawtile :block (fn [tile x y] (rect x y [0.4 0.4 0.4])))
|
2021-03-07 16:55:50 +00:00
|
|
|
|
2022-04-24 23:39:15 +00:00
|
|
|
(set tileset.tetristile
|
|
|
|
{" " {:name :empty
|
|
|
|
:empty true}
|
|
|
|
"X" {:name :wall
|
|
|
|
:wall true}
|
|
|
|
"#" {:name :block
|
|
|
|
:wall true}})
|
2021-03-07 16:55:50 +00:00
|
|
|
|
2021-03-30 23:24:52 +00:00
|
|
|
tileset.hot
|
2021-03-07 16:55:50 +00:00
|
|
|
|