Skip to content

Sample Random Level Generator

Raluca D. Gaina edited this page Feb 12, 2018 · 1 revision

This is a very simple level generator. It generates levels by placing the defined sprites at random empty positions, then surround the borders with solid tiles. Each tile position has a probability (set to 10% to give the best playable and visually appealing) to be filled with a random sprite picked using a uniform distribution. This probability can be adjusted to generate more or less cluttered levels. The generated levels have size proportional to the number of game sprites defined. The generator ensures that the produced levels have at least one of every sprite and only one avatar.

Table of Contents:

Clone this wiki locally