Skip to content

RodEsp/maze-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

maze-generator

A tiny game that creates a maze as a player moves through it.

It works by semi-randomly deciding which neighbors should be connected to the cell that the player moves to. In other words, as a player moves to a new tile in the maze, the generator fills in the walls of that tile. It ensures that there is always at least one way to exit the tile so that the player does not get stuck.

The starting location of the player is randomly chosen from the available tiles at the start of the program. An exit, shown as a green circle when no more than 3 tiles away, is also chosen randomly at the same time.

The generator works with any given number of columns and rows, which can be editted at the top of main.rs with the NUM_OF_ROWS and NUM_OF_COLS constants.

Running the generator

  1. Make sure you have Rust installed.
  2. Clone this repository.
  3. Run cargo run at its root.

Playing the game

You can move your player with the arrow keys.

The only objective right now is to find the exit. It will be visible in the maze when the player is at a distance of 3 tiles or less from it.

maze

About

A tiny game that creates a maze as you move through it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages