Hello guys today we’ll be making a tutorial on how to make a Minecraft 2-d game with game maker 8 or actually just game maker because I assume anything from game maker will work on any other day major platforms that’s more updated than this like game maker Steve so um uh The first thing we’ll be doing actually is this tutorial will be going through train generation terrain generation will be using my script that I thought of just recently like a couple of hours ago so um I haven’t really tested this script out so I’m gonna make a lot of Mistakes but I hope you bear with me so the first thing we’re gonna do is we’re going to make a sprite called spr sprite block we edit this and just add a block and what we’re gonna do is we’re going to put some brown I’ll be dirt and let This one we put in some scrape or stone and with another one will be just adding some grass oops guess what that it’s just brown and then we’ll be adding a little grass type thing to it so some green so there we go it’s not the best But it’s something now with all that we have image0 is grasped and after that image 1 and is dirt and image 2 is stumped so now we’re going to do is um we’re going to be making a object called p parent par-4 now will be a block it Won’t need anything all it needs is to be checked on solid now when they can make another one it’ll be called obj control same thing except know something and make yet another one called obj block or now we’ll be making dress set the sprite as spr block and then to create control Toronto code image index equals zero image speed equals zero ok if you don’t know already image index is white image what sprite it’ll be shown like 0 will be the grass one will be the dirt two will be the stump image speed is to keep The if you set it to 0 0 it’ll keep the sprite from changing to grass from grass to der to stone over and over again in an animation but if it’s above zero like if it’s one it’ll do that so we’re going to keep it at zero um now we’re just Going to copy this a couple of times and make like dirt and we’ll change this the image index to one for dirt and for stone it’ll be too so now we’re gonna make a we’re gonna make some coke so let’s just name this generate and what We’re gonna do is we’re gonna make a for loop it’s let’s just make it and i’ll explain what for loop is so you just put in four and then brackets let’s do XX diesel 0 XX + e um it’s smaller than room with XX plus equals 32 So what this does is a for loop does is it’ll check if c x axis zero then if x axis smaller than room with if it is smaller than room will add 32 2 xx and then repeat this whole loop again little Pete it all over again until it reaches To room with when it’s room with real quick net so now we just add these and open closed bracket 2 and then we can just do instance create XX because now that this is a variable so we can use it uh why why which will will make why why In a second obj grass hmm so here we go let’s make why why why why equals to room height divided by two so now we’re gonna do right after you make that grass we’re going to do shoes and then we’ll do open closed bracket hmm and we’ll do Minus 32 plus 30 20 I don’t know what actually let me think let’s actually do YY plus equals shoes- 32 plus 30 to 40 so what this does is they’ll add a little bit of training randomization by making it go up or down or stay the same So let’s play this real quick and see if it works oh wait you gotta make a room and in the room we’re gonna throw in our control that’s all we need actually oh and I forgot some you can make this code by the will not work until you get Something to activate it so you can go to add event in the control object and we’ll make create and throw in some code and do generate just put in generate and if it has purple text that means it’s talking about this script so then they’ll do open and close bracket and It’ll launch that script hmm so as you see here we’re getting some little random random generation train generation most none of this is going straight to straight across like we have this straight across and such so swim as hills so that’s good but let’s go over here we’re going to do keyboard space Broom start so this way we can take a look at what else there is so see the trains are different now if i restart the room it’s different again different oh it’s different it’s never the same so one thing we do see sometimes is we do See some sort of a we kind of see it repeating itself it’ll makes train that kind of looks the same so to fix this we can do randomized and now it will never be exactly the same not anymore at least so it’ll always be different no matter How many times we change this so um but look we don’t have any dirt underneath this organ yup nor do we have a any stone that’s not that’s not good at all so we’re going on to generate and I haven’t really made a coke please I Haven’t thought of this so what we can do is on my guess is we could take YY let’s / no way let’s do a stone level I have not thought of this um dirt level we’re making a variable equals now we’ll make it higher up up here so now instead Level will equal to shoot we can’t do that either yeah let’s just make the variables down here dirt level equals 2y y plus there too and then stone level equals to dirt level / 2 so this way we’ll have some grass or sumter maybe what makes them will make a cook pork But i think this video is getting up to be a little long i’ll make a part two and i’ll see you then so peace out hope you enjoyed subscribe comment do awesome stuff so see you Video Information
This video, titled ‘Minecraft 2D – 1 – Random Terrain Generation (P1)’, was uploaded by Dr.Magical on 2013-12-31 21:30:29. It has garnered 54 views and 0 likes. The duration of the video is 00:10:06 or 606 seconds.
This is our first GameMaker Tutorial, in this tutorial we’ll be making a Minecraft 2D game, and the first thing that a Minecraft 2D game needs, is Random Terrain Generation! So we’ll be making a simple RTG script, hope you enjoy!