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:
parent
72edcff323
commit
7082a4088b
5 changed files with 61 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue