├── .gitignore ├── LICENSE ├── README.md ├── index.html ├── sketch.js └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .history 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 torin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stsmapgen 2 | 3 | The map generator inspired by [Slay the Spire](https://store.steampowered.com/app/646570). 4 | 5 | **I do not authorize the use of anything generated by this project for the selling of NFTs.** 6 | 7 |  8 | 9 | ## Theory 10 | 11 | 1. Set the start point and the end point. 12 | 2. Prepare points with Poisson disk sampling. 13 | 3. Generate links with Delaunay triangulation. 14 | 4. Find the path from the start point to the end point with A*. 15 | 5. Exclude random points on the path. 16 | 6. Repeat steps 4 and 5 several times. 17 | 7. Complete! 18 | 19 | ## License 20 | 21 | stsmapgen is licensed under the MIT license. See the [LICENSE](https://github.com/yurkth/stsmapgen/blob/master/LICENSE) for more information. 22 | 23 | Libraries: 24 | 25 | - [poisson-disk-sampling](https://github.com/kchapelier/poisson-disk-sampling) from [kchapelier](https://github.com/kchapelier) is licensed under the MIT license. 26 | - [Delaunator](https://github.com/mapbox/delaunator.git) from [mapbox](https://github.com/mapbox) is licensed under the ISC license. 27 | - [ngraph.path](https://github.com/anvaka/ngraph.path) from [anvaka](https://github.com/anvaka) is licensed under the MIT license. 28 | - [ngraph.graph](https://github.com/anvaka/ngraph.graph) from [anvaka](https://github.com/anvaka) is licensed under the BSD 3-Clause license. 29 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 |31 | The map generator inspired by 32 | Slay the Spire. 33 |
34 | Refresh 35 | View 36 | on GitHub 37 |