about summary refs log tree commit diff
path: root/src/Xanthous/Entities.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-11-29 Implement saving+loading the gameGriffin Smith1-12/+2
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-10-16 Add draw priorityGriffin Smith1-0/+16
Rather than blindly taking one entity from the list when we have multiple entities on the same tile, add a `drawPriority` method to the Draw typeclass which allows individual entities to request to be drawn on top - this avoids the "noodles floating over your head" bug we saw before.
2019-10-06 Export unexported lensGriffin Smith1-0/+1
2019-10-06 Allow eating edible itemsGriffin Smith1-5/+7
Add menu support to the prompt system, and an "Eat" command that prompts for an item to eat and eats the item the character specifies, restoring an amount of hitpoints configurable via the item raw type.
2019-09-28 Implement the start of creature AIGriffin Smith1-55/+11
Add a Brain class, which determines for an entity the set of moves it makes every step of the game, and begin to implement that for gormlaks. The idea here is that every step of the game, a gormlak will move towards the furthest-away wall it can see.
2019-09-20 Describe what you see when you walk over itemsGriffin Smith1-0/+3
Every step the character takes, describe the entities at that position excluding the character.
2019-09-19 Add items and inventoryGriffin Smith1-4/+44
Add a new "Item" entity, which pulls from the previously-existent ItemType raw, and add a "PickUp" command which takes the (currently *only*) item off the ground and puts it into the inventory.
2019-09-15 Progressively reveal the map to the playerGriffin Smith1-3/+13
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.
2019-09-09 Convert generated levels to wallsGriffin Smith1-8/+72
Add support for converting generated levels to walls, and merge one into the entity map at the beginning of the game. There's nothing here that guarantees the character ends up *inside* the level though (they almost always don't) so that'll have to be slotted into the level generation process.
2019-08-31 Add entities, and allow walking aroundGriffin Smith1-0/+64
Add support for entities via a port of the EntityMap type, and implement command support starting at basic hjkl.