Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/GameMakerDiscord/random-level-gen-gms2
A random level generation example (similar to Nuclear Throne) using GameMaker Studio 2
https://github.com/GameMakerDiscord/random-level-gen-gms2
example gamemaker gms2
Last synced: 3 months ago
JSON representation
A random level generation example (similar to Nuclear Throne) using GameMaker Studio 2
- Host: GitHub
- URL: https://github.com/GameMakerDiscord/random-level-gen-gms2
- Owner: GameMakerDiscord
- License: mit
- Created: 2018-02-01T15:00:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T05:24:01.000Z (almost 7 years ago)
- Last Synced: 2024-08-02T07:10:59.511Z (6 months ago)
- Topics: example, gamemaker, gms2
- Language: Game Maker Language
- Size: 48.8 KB
- Stars: 48
- Watchers: 6
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gamemaker - Random Level Generator - A random level generation example (similar to Nuclear Throne) using GameMaker. (Levels / Recommendations)
README
# Random Level Generation
A random level generation example (similar to Nuclear Throne) using GameMaker Studio 2.Maintained by: uheartbeast
This example project uses a DS Grid to generate a random level. This level generation process looks somewhat like this:
- Create a grid
- Fill the grid with VOID cells (some number that represents an area that can't be walked on)
- Create a controller at the center of the grid
- Move the controller in a direction (0, 90, 180, 270) and create a FLOOR cell (some number that represents an area that CAN be walked on) in each location
- If the controller hits a wall reverse the direction
- Every step the controller has a random chance of choosing a new direction
- Run the controller for a fixed amount of steps (400 or so)
- Once the level has been generated, loop through and remove any isolated VOID cells (This just makes the level look cleaner and a bit less "random")After generating the level, we fill the game room with tiles using the bitmasking method taught in this article: https://gamedevelopment.tutsplus.com/tutorials/how-to-use-tile-bitmasking-to-auto-tile-your-level-layouts--cms-25673
Finally, we use binary math to detect for collisions in the level's DS Grid.
![random level gen gif](https://user-images.githubusercontent.com/35774957/35686554-c1e73e1c-0729-11e8-84e7-f71b29f87354.gif)