about summary refs log tree commit diff
path: root/src/Xanthous/Orphans.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-09-10T00·54-0400
committerGriffin Smith <root@gws.fyi>2019-09-10T00·54-0400
commit9ebdc6fbb446fea5e505172a6b3dd459beaf3552 (patch)
treea1403026afb597e12c25e84ef8991f062655e5b8 /src/Xanthous/Orphans.hs
parente01cf9b0565eaa9c09e19f66331a2010aea908cb (diff)
Convert generated levels to walls
Add support for converting generated levels to walls, and merge one into
the entity map at the beginning of the game.

There's nothing here that guarantees the character ends up *inside* the
level though (they almost always don't) so that'll have to be slotted
into the level generation process.
Diffstat (limited to 'src/Xanthous/Orphans.hs')
-rw-r--r--src/Xanthous/Orphans.hs28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/Xanthous/Orphans.hs b/src/Xanthous/Orphans.hs
index 3efe1f1264c2..c84756eb1e67 100644
--- a/src/Xanthous/Orphans.hs
+++ b/src/Xanthous/Orphans.hs
@@ -2,23 +2,24 @@
 {-# LANGUAGE ViewPatterns #-}
 {-# LANGUAGE UndecidableInstances, PatternSynonyms #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
--- |
-
+--------------------------------------------------------------------------------
 module Xanthous.Orphans
   ( ppTemplate
   ) where
-
-import Xanthous.Prelude hiding (elements)
-import Text.Mustache
-import Test.QuickCheck
-import Data.Text.Arbitrary ()
-import Text.Megaparsec (errorBundlePretty)
-import Text.Megaparsec.Pos
-import Text.Mustache.Type ( showKey )
-import Data.List.NonEmpty (NonEmpty(..))
+--------------------------------------------------------------------------------
+import           Xanthous.Prelude hiding (elements)
+--------------------------------------------------------------------------------
+import           Data.Aeson
+import           Data.List.NonEmpty (NonEmpty(..))
 import qualified Data.List.NonEmpty as NonEmpty
-import Data.Aeson
-import Graphics.Vty.Attributes
+import           Data.Text.Arbitrary ()
+import           Graphics.Vty.Attributes
+import           Test.QuickCheck
+import           Text.Megaparsec (errorBundlePretty)
+import           Text.Megaparsec.Pos
+import           Text.Mustache
+import           Text.Mustache.Type ( showKey )
+--------------------------------------------------------------------------------
 
 instance forall s a.
   ( Cons s s a a
@@ -181,3 +182,4 @@ instance ToJSON Color where
 instance (Eq a, Show a, Read a, FromJSON a) => FromJSON (MaybeDefault a) where
   parseJSON Null = pure Default
   parseJSON x    = SetTo <$> parseJSON x
+