From e77c8b23c148ffaa5991da18c981e61db2a5e55c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 1 Apr 2013 23:01:59 -0400 Subject: Initial commit Haskell version now has most of the functionality from the C++ version, except for color, and overworld generation is REALLY slow. --- Fallen/Tiles.hs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Fallen/Tiles.hs (limited to 'Fallen/Tiles.hs') diff --git a/Fallen/Tiles.hs b/Fallen/Tiles.hs new file mode 100644 index 0000000..e64a650 --- /dev/null +++ b/Fallen/Tiles.hs @@ -0,0 +1,30 @@ +module Fallen.Tiles +( Tile(Grass, Earth, Passage, Floor, Forest, Rock, Water), + drawTile, + passableTiles +) where + import UI.HSCurses.CursesHelper + + data Tile = Grass | Earth | Passage | Floor | Forest | Rock | Water deriving (Show) + + instance Eq Tile where + Grass == Grass = True + Earth == Earth = True + Passage == Passage = True + Floor == Floor = True + Forest == Forest = True + Rock == Rock = True + Water == Water = True + _ == _ = False + + drawCharWithColor ch color = toEnum $ fromEnum ch + + drawTile Grass = drawCharWithColor '.' GreenF + drawTile Earth = drawCharWithColor ' ' BlackF + drawTile Passage = drawCharWithColor '.' GreyF + drawTile Floor = drawCharWithColor '.' GreyF + drawTile Forest = drawCharWithColor '~' GreenF + drawTile Rock = drawCharWithColor '*' GreyF + drawTile Water = drawCharWithColor '~' BlueF + + passableTiles = [Grass, Passage, Floor] \ No newline at end of file -- cgit 1.4.1