Instructions in-game. Before watching, read the requirements. THIS IS A 2D MINECRAFT NOT A 3D MINECRAFT! DO NOT BE MISTAKEN!
Requirements are on the screen to the left before pressing the green flag. Credit to Mojang for the Minecraft game. Everything else by me. More Detailed Explanation of the Generation Script (Read after Watching): When you press the green flag, it will hide the tiles sprite. This is because all of the visuals are made using stamping. We then set the size to 400. This is because the sprites are only 8x8 px because this size is good for making a minecraft block. So with that, we are basically setting it's size to 32px. Next, we set our costume to sky... this isn't really needed. the we go to -224 164. This is the top left corner of the screen. Then we clear the screen. This gets rid of any previously made stamps. Then we add a repeat 14. This is the amount of tiles we generate on the x axis or to the right. Then, inside of that we set a variable called biomeHeight to a random value between 3 and 6. This determines how much sky there is, hence creating different sized hills. Then we set our y axis to 164 (The top). Then we repeat biomeHeight times. Inside of this repeat, we add a switch costume to sky to add sky, stamp, and change our y by -32px (Size of our tile). Then outside of the loop we just created, we set a variable called positionY to 12. This helps the project figure out what the correct tile to stamp is(Grass, Dirt, Stone, ect.). Then we add a repeat by 11-biomeHeight. 11 is the amount of tiles we create on the y axis. Then we subtract what the sky has already created, and vwalla! The project has figured out how many tiles to use. Inside of this, we add an if else. The if else says, if positionY = 1 then. Inside of the if, we switch the costume to grass. This makes the top layer of every biome grass. Then, in the else, we add another if else. This if says, if positionY < 3. Then it sets the costume to dirt. This adds one layer of dirt. You can make this amount of 3 larger for more dirt. If none of these work, we add stone. You could easily and ores by using a pick random to choose stone or your ores, read that value and add ifs in there to check what ore to use. Now we are done with all of those if elses. Were onto the plain if. This if says, if positionY = 11 - biomeHeight then. This checks if we are on the last layer. It will switch the costume to bedrock if it is. After this if, we stamp our costume. This will do the appropriate block using all of the ifs logic and the costume switching. Next, we change our y by -32. This moves us down one block. Then, it will change the positionY by one. This will repeat until it finishes the column. Outside of this repeat, and into the first one, we change our x by 32. This is the end of the script. Test it out! If you have any errors, please comment in the comments below so I can help. Thanks for watching, and reading! Scripts, Tutorial, and Everything else by Yours Truly.