diff --git a/flora-sercha-sauna.lisp b/flora-sercha-sauna.lisp
index be088f2..7c59165 100644
--- a/flora-sercha-sauna.lisp
+++ b/flora-sercha-sauna.lisp
@@ -21,9 +21,10 @@
(ql:quickload :cl-tiled)
+
(defun main ()
(clear-screen)
- (draw-map "/home/jaidyn/.local/src/games/flower/res/mom.tmx"))
+ (draw-map "/home/jaidyn/.local/src/games/flower/res/map.tmx"))
(defun move-cursor (row column &key (stream *standard-output*))
@@ -40,19 +41,33 @@ Borrowed from https://github.com/gorozhin/chlorophyll/
(defun draw-map (map-path)
+ "Draw a Tiled-format tilemap to the screen."
(mapcar #'draw-tile-layer
(cl-tiled:map-layers (cl-tiled:load-map map-path))))
(defun draw-tile-layer (tile-layer)
+ "Draw a Tiled tile-layer to the screen."
(mapcar #'draw-cell
(cl-tiled:layer-cells tile-layer)))
(defun draw-cell (cell)
- (move-cursor (cl-tiled:cell-row cell)
- (cl-tiled:cell-column cell))
- (write-char #\A))
+ "Draw a specific cell of a tile-layer to the screen."
+ (move-cursor (+ (cl-tiled:cell-row cell) 1)
+ (+ (cl-tiled:cell-column cell) 1))
+ (write-char (tile-character
+ (cl-tiled:cell-tile cell))))
+
+
+(defun tile-character (tile)
+ "Given a tileset's tile, return it's corresponding text character,
+assuming that the tileset is a bitmap font starting with char-code 32
+with 15 characters-per-line."
+ (code-char
+ (+ (* (cl-tiled:tile-row tile) 15)
+ (cl-tiled:tile-column tile)
+ 32)))
(main)
diff --git a/res/font.png b/res/font.png
new file mode 100644
index 0000000..2a74303
Binary files /dev/null and b/res/font.png differ
diff --git a/res/font.tsx b/res/font.tsx
new file mode 100644
index 0000000..845ea58
--- /dev/null
+++ b/res/font.tsx
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/res/font.txt b/res/font.txt
new file mode 100644
index 0000000..054b129
--- /dev/null
+++ b/res/font.txt
@@ -0,0 +1,18 @@
+A Tiled tileset generated from Fira Code Regular⁽¹⁾ printable ASCII characters.
+This is (ofc) not used in the game, but is very handy for visualizing the map in Tiled!
+
+Generated thanks to the beautiful program ttf2png⁽²⁾, like so:
+ $ ttf2png -r 32,126 -s 15 -l 15 -e -t -o font.png FiraCode-Regular.ttf
+
+Note `-l 15`, which sets the row-length to 15. This is very important!
+Flora's engine parses the tiles' character values by calculating the tile's
+[15(row - 1) + column].
+Could we avoid this, and automatically figure out the row-length? Yeaaa.
+Could I be bothered? Nooo.
+
+
+[1] https://github.com/tonsky/FiraCode
+Fira Code © 2014 Fira Coda Authors, SIL OFL 1.1
+
+[2] https://www.tdb.fi/ttf2png.shtml
+TTF2PNG © 2021 tdb, GNU GPLv1
diff --git a/res/map font.png b/res/map font.png
deleted file mode 100644
index 017a3e7..0000000
Binary files a/res/map font.png and /dev/null differ
diff --git a/res/map font.tsx b/res/map font.tsx
deleted file mode 100644
index f6406b4..0000000
--- a/res/map font.tsx
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/res/map font.txt b/res/map font.txt
deleted file mode 100644
index 2064fa7..0000000
--- a/res/map font.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-License: CC0
-Author: domsson
-URL: https://opengameart.org/content/ascii-bitmap-font-oldschool
-
-Used as a tilemap in Tiled — just to help visualize the maps!
diff --git a/res/map.tmx b/res/map.tmx
new file mode 100644
index 0000000..e5fb81e
--- /dev/null
+++ b/res/map.tmx
@@ -0,0 +1,28 @@
+
+
diff --git a/res/mom.tmx b/res/mom.tmx
deleted file mode 100644
index 7b82f77..0000000
--- a/res/mom.tmx
+++ /dev/null
@@ -1,28 +0,0 @@
-
-