Hello there derp I’m gonna show you how to create a basic minecraft terrain generation in game maker yeah that’s right so start off by creating a group called blocks the blocks and create a sprite grip called blocks relax and hit the button right here and then you will Right-click the object thing and we’re gonna create an object called world Jen underscore object OBG and by the way I am from Sweden so excuse my English H so start off by you know yeah okay mmm then you right click the block sprite and create a sprite called dirt underscores SPR and I did it I’m gonna create a dirty sprite car with by the width of 16 and a height of 16 and we will try to draw some injured which I will probably fail at not a pixel artist but I will do my best actually I had Nevermind and then we will hit okay okay and we will create an object cold dirt underscore OBG and we will add this right to it and then we will hit okay and then we will create another block I’m just called block – go Rob underscore object and this block doesn’t Need any sprite because it’s just gonna be a parent anywhere else mark this as solid and then we will add a mouse left button destroy this will make it so that we can destroy blocks – that’s pretty funny here and then we will yeah go – I’m gonna set a parent Which will be the block object then you will go to the world in and we will add a dipper even and we will start off with if X is with 2003-4 then the magic will happen then we will create a for loop for I equals 0 I is listening Room I minus y then i plus equals the size of the blocks which will be 16 16 and then we will add myrrh this curly brackets 1 2 3 4 and then we will add instance create XY plus I and then a variable called block block and the Block will be equal to block for now block will be equal to equal to dirt object so this will this pretty much means this which is this so it will it will instantiate this this block did it I did it at random Heights so yeah let’s make those random Heights possible X Plus equals sixteen this will make the world generation go forward and now it will make it go up and down at random positions so why why is the these positions and X equal is this position so y plus equals 16 times round random choose one two or three times choose one Or minus one yeah then we will make it so we can restart the generation with this code if keyboard shake poured our room or start so whenever you press the are key on your keyboard you will restart the generation of the world now we will create a room called world and We will add add the world getting a ticket right up what almost in the middle and hit OK and then we will hate the plea now when you press R it will do random as you can see this is working pretty good and now I’ll create some grass We will ask me grass to the world so duplicate the dirt sprite and name it grass svr and we will draw some grass on top of it like this that’s good and then we’re like okay and okay and then we will duplicate this – and we’ll end naming grass a B and then We will rest on yeah I’m sorry if I am thing if I talk too fast first the fall but see the word chip and then we will do if floor no yeah if slower random no not random this will it will not be random instance create you is why grass Slide and we will hit okay and then we will try dish out and as you can see this works then we will go to some stuff as you can see when you mmm but when you destroy black grass does not grow here we will fix that go to the Dirt okay and we will add a code to this step food and then we will do like if your random 1000 equals zero goes to zero what you pay for then our instance change grass so at a chance chance of thousand it will change into grass let’s see how this works Oh I made a mistake mm-hmm so we’ll have to check if the place above the block is empty too and and place between X Y minus 16 now this will work this will look fine now this will look so good now excuse you can see grass will grow isn’t This beautiful grass does grow it might be a bit slow but it’s working if you want it to grow faster you can decrease this number yeah that value so now we will add stone to the generation so duplicator sprite I know why you duplicated with butt and stone on the Score SPR and we will make some beautiful pixel art here yeah that’s pretty good okay and hit okay and we will create a block called stone on score table OBG and it will be a parent block and it will be we will satisfied for its stone And I will go to the word generation insta and we will do if I is larger than 16 times choose one no four three four five then block equals skilled now there will be still in the world – oh god this is amazing and as you can she grass grow now I’m so Sorry for that now we’ll add flowers yes flowers flower on the score SPR I did file new almost everything will be 16 x 16 in the Minecraft world so we’re gonna draw a beautiful flower it’s not just beautiful I bet you wish that you could draw like me this beautiful flower And I will create an object for it to flower and score object and we will add it and what the heck let’s let’s make it preparing to block – nothing wrong with that except this will get solid and then we’ll do you think that there will be Flowers now do you really think that no you’re wrong we have to add it to the generation code so instance create X Y minus 16 in an hour oh now there will be flowers everywhere and that’s not very realistic so what we’re gonna do is that we’re gonna do Make it more random so if Fleur random 50:50 equal to C equal to zero then this will happen happen now there will be more randomly generated flowers do like my British English I’m not making I’m not offending everybody at anyone I’m sorry for my English I’m a speedy speedy today because I don’t know yeah as you can see this this is really beautiful this is so you must think that I am pretty annoying yeah but this works pretty good this is all that I’m gonna going to show you at this part of the tutorial if I get Enough views on this video I will probably create a part two where I will show you how to create biomes like deserts and jungles and stuff at random places doesn’t that sound epic yeah I thought so so please subscribe if yeah if I get enough subscribers I will also do the Part to you I will or if I get enough views I’m sorry for my English yeah but hopefully you will see me in a part 2 video yeah but Video Information
This video, titled ‘Game Maker – Minecraft 2D terrain generator [Tutorial]’, was uploaded by Sebbe Karlsson on 2012-11-12 17:32:16. It has garnered 8070 views and 56 likes. The duration of the video is 00:15:21 or 921 seconds.
I am showing you how to create a random terrain generator in game maker 🙂 I will show you how to add biomes and much more if I get alot of views and subscribers :3