about summary refs log tree commit diff
path: root/src/Xanthous/Generators
AgeCommit message (Collapse)AuthorFilesLines
2020-01-05 Add staircases, and moving between levelsGriffin Smith1-1/+7
Currently we just pick randomly between the cave and dungeon level generators. There's a lot of bugs here, but it's *sorta* working, so I'm leaving it as is.
2020-01-03 Track entity collision in the Entity classGriffin Smith1-0/+2
Rather than having a single function in the Game.Lenses module for determining what collision type if any an entity has, track it in the Entity typeclass itself. This is both more extensible and a better separation of concerns and gets rid of one of the two needs for a circular import. Yay! As part of this, I realized nothing was being done to prevent doors from being placed on tiles that already had walls (since now that was properly causing a collision!) so I've fixed that as well.
2019-12-30 Place doors on the levelGriffin Smith1-11/+34
Pick a random subset of cells on the level that have a wall on two opposite sides and are clear on the other two sides, and place closed, unlocked doors on those cells.
2019-12-30 Add dungeon level generationGriffin Smith3-19/+211
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-9/+40
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-11-30 Add messages on the groundGriffin Smith1-3/+26
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-09-21 Implement combatGriffin Smith1-15/+28
Put a bunch of gormlaks randomly on the level, and implement combat via damaging those gormlaks by one point.
2019-09-20 Add doors and an open commandGriffin Smith2-2/+2
Add a Door entity and an Open command, which necessitated supporting the direction prompt. Currently nothing actually puts doors on the map, which puts a slight damper on actually testing this out.
2019-09-19 Add items and inventoryGriffin Smith1-8/+32
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 Remove all but the largest region in cavesGriffin Smith2-4/+12
When generating cave levels, remove all but the largest contiguous region from the resulting level.
2019-09-15 Progressively reveal the map to the playerGriffin Smith1-8/+0
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-14 Fill the outer edges of generated levelsGriffin Smith2-1/+13
To avoid the character being able to go OOB. This is something we had in the Rust version but I hadn't ported over yet
2019-09-13 Place the chacracter in the level at startup timeGriffin Smith3-11/+116
Randomly select a position in the largest contiguous region of the generated level in which to place the character at startup time.
2019-09-09 Convert generated levels to wallsGriffin Smith1-0/+29
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-09-07 Add cellular-automata cave generatorGriffin Smith2-0/+182
Add a cellular-automata-based cave level generator, plus an optparse-applicative-based CLI for invoking level generators in general.