Hi guys and welcome to a brand new tutorial on how to create Minecraft today in game maker 8 the pro version ok so you want to create some sprites and one grass wondered once done which are 32 by 32 the textures are from the original minecraft and you want to Create some objects and scripts and scripts will be the world generation and the world generation is completely random okay so we get like the starting height the starting position and this will be chosen very randomly in these values so why these values well these fellows are chosen actually because the 240 here is the same as the room height divided by 2 so you can say room height divided by 2 minus 32 minus 64 plus 32 or plus 64 okay so this is the starting height and then we get something like a variable which will follow the starting Right every time it changes okay so the starting height is the height of the Y position in the beginning when this script is executed but when you change when the computer changes the position it obviously changed the starting height so you need to see it like this this is The starting height okay this is the starting right then it changes and then this this hi is the alternate height this height is the ultimate height this height is the ultimate height okay so the alternate height equals the starting line on the beginning when this script is executed The alternate how it will be the same thing as the starting height but later on it changes okay so then we get a dirt level a stone level and a variable which will follow the dirt level the latest the lowest dirt level so that’s actually so that’s actually the alternate dirt Level so the for loop in this random terrain generation will be if X is the same as 0 which is the x position yeah which is the x position of the starting right that’s my my clock right there and the X is smaller the X is smaller than The room with then take a step of 32 and the 32 is the size of our sprites you what it do wrong you and this is just the plain volume so I’ll say me and the dirt level is the alternate height plus 32 because the alternate height is still Changing but the dirt level is the same as the alternate height plus this level so at the beginning the dirt level is the same as the starting height plus this value and then every step it takes is the alternate I plus this value and the stone level is the same thing after Room all right and the room height is 480 so in this for loop we will create the instance object cross and that is the start the alternate height which is constantly changing well not yet but when I say this when I say that it will constantly change and not only efforts were but Always but also downwards sorry so we’ve got another photo which is the wah-wah for the dirt level you so as long as YY is the same as the ultimate light as long as the dirt level is the same as the object cross but wait wait a second dirt level small and revivalism Then it will take steps of 32 pistons create xx YY plus 32 so this 32 will say that B YY is alternate is the alternate height but it’s 32 plus object do it okay and then this while I will be the same as the ultimate dirt level which We’ll define the position of the stone while I smell a star level smaller than the room height then it will take a step so these are actually the same but the ADL yes this dirt level position also plus 32 you so because this is plus 32 this gets Plus 32 but then it will actually be the same and this alternate height this dirt level will not go up will not operate anymore so we need to say plus 64 objects so let’s do that you I forgot one thing to actually create the object which will execute our our script Then actually set and I said the object will generation in our room and we get this nice random terrain so then if you want to test your game without without just starting the game and closing the game starting the game etc you we can say to our object That every time you press a restart button the room will restart it’s much easier so why don’t we do that in our object say that when the restart position of a restart restart button press and just boom restart and get this you that’s pretty cool right so that’s random terrain Yeah see you on the next tutorial Video Information
This video, titled ‘Game Maker Tutorial – Minecraft 2D Part 1: Random Terrain Generation’, was uploaded by GMLtouch on 2013-10-27 17:53:21. It has garnered 99656 views and 667 likes. The duration of the video is 00:10:07 or 607 seconds.
This tutorial shows you guys how to create a random terrain generation! Remember this is part 1! More exciting tutorials are coming!
Patreon: https://www.patreon.com/gmltouch
Check out my other, more awesome, tutorials!! Like light systems, inventory & crafting systems, backgrounds, steve, biomes, falling sand, and more!
Click here for Part 2: http://www.youtube.com/watch?v=E9XK2hIqSBc Click here to see Part 3 (Infinite Terrain): http://www.youtube.com/watch?v=RbbssOeuHO4 Click here to see Part 4 (Down to Bedrock): http://www.youtube.com/watch?v=_o8k58qcjk8 Click here to see Part 5 (Trees!): https://www.youtube.com/watch?v=owOdt33FcQk
I do not own the rights to this music/song and do not condone ownership, no copyright infringement intended.