Store revealed positions on the level itself

This was a bit of an oversight initially - we should be storing the
positions that the character has seen *on the level*, rather than on the
entire game state, for obvious reasons. This introduces a GameLevel
record, which has this field, the entities, and also the up staircase
position, which we can *also* use to position the character after going
down to a level we've already visited.
This commit is contained in:
Griffin Smith 2020-01-20 11:37:37 -05:00
parent 72edcff323
commit 7082a4088b
5 changed files with 61 additions and 19 deletions

View file

@ -39,14 +39,16 @@ initialStateFromSeed :: Int -> GameState
initialStateFromSeed seed =
let _randomGen = mkStdGen seed
chr = mkCharacter
(_characterEntityID, level)
_upStaircasePosition = Position 0 0
(_characterEntityID, _levelEntities)
= EntityMap.insertAtReturningID
(Position 0 0)
_upStaircasePosition
(SomeEntity chr)
mempty
_levelRevealedPositions = mempty
level = GameLevel {..}
_levels = oneLevel level
_messageHistory = mempty
_revealedPositions = mempty
_promptState = NoPrompt
_activePanel = Nothing
_debugState = DebugState