From dcf44f29f5df75dedae62a9820b06d7c4cd36df1 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 30 Dec 2019 12:30:12 -0500 Subject: Place doors on the level Pick a random subset of cells on the level that have a wall on two opposite sides and are clear on the other two sides, and place closed, unlocked doors on those cells. --- src/Xanthous/Entities/Environment.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Xanthous/Entities/Environment.hs') diff --git a/src/Xanthous/Entities/Environment.hs b/src/Xanthous/Entities/Environment.hs index 0690e47e5441..c34f2e0634d6 100644 --- a/src/Xanthous/Entities/Environment.hs +++ b/src/Xanthous/Entities/Environment.hs @@ -7,6 +7,7 @@ module Xanthous.Entities.Environment , Door(..) , open , locked + , unlockedDoor -- * Messages , GroundMessage(..) ) where @@ -88,6 +89,13 @@ instance Entity Door where description _ = "a door" entityChar _ = "d" +-- | A closed, unlocked door +unlockedDoor :: Door +unlockedDoor = Door + { _open = False + , _locked = False + } + -------------------------------------------------------------------------------- newtype GroundMessage = GroundMessage Text -- cgit 1.4.1