about summary refs log tree commit diff
path: root/src/Xanthous/Util
AgeCommit message (Collapse)AuthorFilesLines
2019-11-30 Fail on all warnings in CIGriffin Smith1-1/+0
All the undefineds are gone, so it's time to enable -Werror in CI.
2019-11-29 Add DerivingVia newtype for generic arbitraryGriffin Smith1-1/+16
Add a newtype, GenericArbitrary, which can be used with -XDerivingVia to derive Arbitrary instances for types with Generic, via patching generic-arbitrary to expose the underlying typeclass it uses for surfacing the type information.
2019-11-29 Implement saving+loading the gameGriffin Smith2-0/+47
Implement ToJSON and FromJSON for all of the various pieces of the game state, and add a pair of functions saveGame/loadGame implementing a prism to save the game as zlib-compressed JSON. To test this, there's now Arbitrary, CoArbitrary, and Function instances for all the parts of the game state - to get around circular imports with the concrete entities this unfortunately is happening via orphan instances, plus an hs-boot file to break a circular import that was just a little too hard to remove by moving things around. Ugh.
2019-09-29 Gormlaks attack backGriffin Smith1-1/+1
When gormlaks see the character, they step towards them and attack dealing 1 damage when adjacent. Characters have hitpoints now, displayed at the bottom of the game screen, and when the game is over they die.
2019-09-20 Describe what you see when you walk over itemsGriffin Smith1-0/+15
Every step the character takes, describe the entities at that position excluding the character.
2019-09-15 Progressively reveal the map to the playerGriffin Smith1-0/+64
As the character walks around the map, progressively reveal the entities on the map to them, using an algorithm based on well known circle-rasterizing and line-rasterizing algorithms to calculate lines of sight that are potentially obscured by walls.