Currently the game map is stored as an array of Tiles. Ideally the game map could be a [w*h]rune structure with each tile type having its own character: walls #, doors +, floors . etc. Those tile types can be defined as constants and allow us to write a renderer for ASCII as well as one for graphics mode. This unhooks the rendering functionality from the map structure.
Currently the game map is stored as an array of
Tiles
. Ideally the game map could be a[w*h]rune
structure with each tile type having its own character: walls#
, doors+
, floors.
etc. Those tile types can be defined as constants and allow us to write a renderer for ASCII as well as one for graphics mode. This unhooks the rendering functionality from the map structure.Or as boohu does it here as a
map[rune]string
: