Skip to content

pusewicz/wave-function-collapse-dragonruby

Repository files navigation

Wave Function Collapse in DragonRuby

This repository is an example implementation of the Wave Function Collapse algorithm using DragonRuby.

The algorithm is used to generate the entire map using tiles based on the rules. Rules are defined using the Tiled program and read by the Ruby program from the TSJ file.

Wave Function Collapse in DragonRuby

Live Demo

Because DragonRuby allows building an HTML game, you can test the implementation yourself at https://pusewicz.github.io/wave-function-collapse-dragonruby/. HTML version is slower compared to a native build.

Objective

Build the Wave Function Collapse algorithm in DragonRuby that's fast enough to iterate in a game on each frame.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pusewicz/wave-function-collapse-dragonruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Others

License

The gem is available as open source under the terms of the MIT License.

Credits

Tileset: https://opengameart.org/content/consolidated-hard-vacuum-terrain-tilesets