about summary refs log tree commit diff
path: root/src/Xanthous/Generators.hs
AgeCommit message (Collapse)AuthorFilesLines
2020-01-05 Add staircases, and moving between levelsGriffin Smith1-2/+10
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.
2019-12-30 Place doors on the levelGriffin Smith1-1/+19
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 Smith1-5/+24
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-11-30 Add messages on the groundGriffin Smith1-0/+3
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-13 Implement speed and ticksGriffin Smith1-1/+1
Gormlaks now move 1/8th the speed of the character, which means we can run away from them - yay! Unfortunately this also introduces a bug where they'll eventually get stuck and not do anything, so I'll be tackling that next.
2019-09-21 Implement combatGriffin Smith1-7/+8
Put a bunch of gormlaks randomly on the level, and implement combat via damaging those gormlaks by one point.
2019-09-19 Add items and inventoryGriffin Smith1-3/+38
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-13 Place the chacracter in the level at startup timeGriffin Smith1-4/+4
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-7/+23
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 Smith1-0/+54
Add a cellular-automata-based cave level generator, plus an optparse-applicative-based CLI for invoking level generators in general.