3D Maze in Scratch

by Jacoder in Circuits > Software

719 Views, 2 Favorites, 0 Comments

3D Maze in Scratch

Screenshot 2023-02-23 at 2.16.49 PM.png

This is a 3D maze made entirely with Scratch. It uses clones to detect the nearest object, and then show it on a screen. It is really cool to use, but it is very slow because the quality is so good. So, we will be running this project on a site called Turbowarp, which just takes scratch projects and makes them run faster.

Downloads

Supplies

All you need:

•Any device with a a keyboard and mouse (or touchscreen)

•An internet connection (it does not need to be super speedy)

•A web browser of your choice

Loading the Project

Screenshot 2023-02-23 at 2.41.37 PM 2.png

For this step, all you have to do is go to this link.


https://turbowarp.org/794886677/fullscreen?turbo&hqpen&clones=Infinity


If you look at this link, it will run the scratch project with the ID "794886677" (https://scratch.mit.edu/projects/794886677/), be in fullscreen, be in turbo mode (also helps it run faster), have high quality pen, and infinite clones.

Running the Project

Screenshot 2023-02-23 at 2.46.59 PM.png

To start the project, click the green flag in the center of the screen. All the settings are preloaded for you, so you do not have to do anything else. Now, use your arrow keys to navigate around the map. Get to the next orange wall to advance to the next level. If you press v, you can open up the settings which shows a bunch of variables and lists. They all mean different things:

•"quality" is how good your walls look. The lower you set it, the better they will look, but it will also run slower.

•"Inside" is how hidden the map is. If you set it to 0, the map will show fully, if you set it to 100, it will be all the way hidden, and all the values in the middle will make it more or less see-through.

•"Streaks" should only be changed if your screen is experiencing streaks. If you do have streaks, set it to 0, and increase from there. please note that the higher the value, the more overlap of the walls, and will make the quality decline.

•"Speed" is the speed your character goes. The bigger the value, the faster you will go.

•"Hitbox" is the amount of room between you and the wall that your player will stop moving. If it is 0, you will stop exactly where the wall is. If it is bigger, it will stop farther away. This sometimes will improve quality if increased.

•The lists are the color of the line, and length of line. These are not very helpful to you, but watch the list sizes, If they are taking a long time to go to 120, make the quality variable bigger until it constantly goes to 120. If it is going to 120 instantly, than lower the quality variable until it is the smallest it can be while still maintaining a 120. That will make your experience the perfect mix between quality and speed.

•"Level" is the current level you are on.

•"Collision" is if you can go through walls. if it is ON, then you can't, and if it is OFF, than you can. Use the c key to change this (can be used while in game, you do not have to have the menu open).

How It Works

This project sends out clones, and depending on the quality variable, they will give back a length and a color to draw the line in. Then, a different sprite will draw the sky, ground, and lines based on that answer. That is the basics, but you can comment if you want more.

Add Your Own Levels

To add your own levels, all you have to do is 3 things. First, add a new costume in the MAP sprite, and draw where you want there to be a wall. Make sure to name it a number based of the order you want it to be played. In your map, all walls will be green, and the edges of the canvas will show up orange when in play mode. Then, go into the FINISH sprite, and add a place where you want your maze to finish and the player to be transported to a new level after get to that point. This will not be shown in 3D mode. Finally, go into the list called SPAWNS, and add an x and y position of where your player should spawn for that layer. You should follow the steps below for what number in the list to put them in.

x = order of this stage * 2 -1

y = order of this stage * 2


Ex:

spawns for stage five


x is ninth in list (5 * 2 - 1)

y is tenth (5 * 2)

Thank You

Thank you for reading this! If you enjoyed this please follow me on Scratch:

@Guitardude10


Thanks to Mazegenerator.net for the mazes! If you want to create you own, I recommend going there.