about summary refs log tree commit diff
path: root/src/Xanthous/Util.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-12-30 Add dungeon level generationGriffin Smith1-0/+9
Add a dungeon level generator, which: 1. generates an infinite sequence of rectangular rooms within the dimensions of the level 2. removes any duplicates from that sequence 3. Generates a graph from the delaunay triangulation of the centerpoints of those rooms 4. Generates the minimum-spanning-tree of that delaunay triangulation, with weights given by line length in points 5. Adds back a subset (default 10-15%) of edges from the delaunay triangulation to the graph 6. Uses the resulting graph to draw corridors between the rooms, using a random point on the near edge of each room to pick the points of the corridors
2019-12-30 Fix circle rendering, add filled circleGriffin Smith1-0/+10
Make raster circle rendering use the Rasterific package instead of attempting desperately to hand-roll it, and add a method for generating filled circles.
2019-12-22 Add a wield commandGriffin Smith1-5/+13
Add a Wield command, which prompts for a wieldable item, if any, to take out of the character's inventory and put in their right hand. Eventually we should support other hands, but for now hardcoding the right hand should be fine.
2019-11-30 Add messages on the groundGriffin Smith1-5/+24
Add support for a "GroundMessage" entity type, support for a Read command to read them, and randomly place an initial, tone-setting tutorial message on the ground near the character at the beginning of the game.
2019-10-06 Allow eating edible itemsGriffin Smith1-0/+10
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-0/+1
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-15 Progressively reveal the map to the playerGriffin Smith1-0/+149
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-07 Add cellular-automata cave generatorGriffin Smith1-1/+33
Add a cellular-automata-based cave level generator, plus an optparse-applicative-based CLI for invoking level generators in general.
2019-08-31 Add entities, and allow walking aroundGriffin Smith1-0/+14
Add support for entities via a port of the EntityMap type, and implement command support starting at basic hjkl.