views
729
likes
3

Comments (3)

What do you think?

minecraft 2.0 but its epic :D

Nice relaxing game

Interesting concept, it's like minecraft but with mazes xD

Game Soundtrack

1 song

Uniq - Art of Silence
 

How It Works:

This game is a project I've been working on for a month. It's essentially my own take at a maze generation algorithm. The way it works is first there are 2 "seed" walls randomly placed in the maze, then the game iterates through all the units of the maze (each wall and floor) and checks each unit's surroundings. If there is more than 0 yet less than 3 walls that touch the unit, a wall will be created. The output of this maze is similar to Binary tree algorithm but a bit more flawed with bias around the edges of the maze. It is interesting to note that the maze algorithm works best for mazes that are less than 300 units squared. You can also edit your maze fully with a build and destroy mode as well as walk around it in 3rd person view.

untitled.jpg

How To Play:

This game is an ever expandable sandbox and you can make your maze as big as you want (although I highly don't recommend going above 100, 000 units squared unless you build PCs for NASA). In order to set a maze size hit the "ESC" key and input a value for the rows and columns, next hit confirm and you've got your very own unique maze which you can edit any way you want. Now to add or remove the walls or even build vertically you want to press the "N" key for Build mode and "M" for Destroy mode. To reset your maze just press "SPACE" and you'll respawn in a new maze.


Controls:

  • ESC - Menu

  • N - Build Mode Switch

  • M - Destroy Mode Switch

  • SPACE - Regenerate Maze

  • WASD or Arrow Keys - Move Player/Camera

  • Scroll Wheel - Camera Zoom In/Out


Code:

If you're interested how it works in code here is a section of one of the mechanism

		
			int NewGrid(int i, int j)
    {
        //Is either a 1 or a 0. A 0 means no wall, 1 means wall should be created
        int willTile = 0;

        //Checks if the unit is already a wall and exits the method if it is
        if (grid[i, j] == 1)
        {
            return willTile = 1;
        }

        //New 2D array (Scanning Array) created which takes in all the units 1 unit away from the unit being scanned
        int[,] nGrid = new int[3, 3];

        nGrid[0, 0] = grid[Mathf.Max(0, i - 1), Mathf.Max(0, j - 1)];
        nGrid[0, 1] = grid[Mathf.Max(0, i - 1), j];
        nGrid[0, 2] = grid[Mathf.Max(0, i - 1), Mathf.Min(columns - 1, j + 1)];
        nGrid[1, 0] = grid[i, Mathf.Max(0, j - 1)];
        nGrid[1, 1] = grid[i, j];
        nGrid[1, 2] = grid[i, Mathf.Min(columns - 1, j + 1)];
        nGrid[2, 0] = grid[Mathf.Min(rows - 1, i + 1), Mathf.Max(0, j - 1)];
        nGrid[2, 1] = grid[Mathf.Min(rows - 1, i + 1), j];
        nGrid[2, 2] = grid[Mathf.Min(rows - 1, i + 1), Mathf.Min(columns - 1, j + 1)];

        //SumArray just sums up all the values in the Scanning Array
        int n = SumArray(nGrid);

        //If the Scanning Array contains more than 0 yet less than 3 walls it will return a willTile of value 1. Modifying either one of the values makes major changes to the mazes created
        if (n > 0 && n < 3)
        {
            willTile = 1;

            //This tells the main program that a new wall has been created so the whole maze should be scanned again. This will happen until no new walls are created
            loops++;
        }

        //Returns either a 1 or a zero, tells the main function whether to build the wall or not
        return willTile;
    }
		
	

Credits:

"Uniq - Art of Silence" is under a Royalty Free music license. Music promoted by BreakingCopyright: https://youtu.be/er--pnwFDgU


#adventure #strategy #other #puzzle #altgame #arcade #sandbox #maze #labyrinth #building #algorithm #programming #simulation



all-ages

Algorithm Sandbox now FREE!

Massive sale get the Algorithm Sandbox for only 50 Cents!