about summary refs log tree commit diff
path: root/src/Xanthous/Util/Graphics.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-12-30 Add dungeon level generationGriffin Smith1-4/+32
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-30/+51
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-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-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.