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.
This commit is contained in:
Griffin Smith 2019-12-30 12:30:12 -05:00
parent e76567b9e7
commit dcf44f29f5
4 changed files with 62 additions and 17 deletions

View file

@ -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