Hey guys welcome back to another scratch tutorial in this tutorial i’ll teach you how to make a terrain generator so right now i have a blue sky backdrop and i have a block sprite with a few costumes and i’ll actually delete these costumes just to keep things simple So i just have dirt stone and dress and they’re specifically in this order so i have all those sprites and right now we will take a one flag clip and we’ll broadcast a message we’ll call it reset and we’ll take when i receive reset we’ll make a block and we’ll call it render And run screen without refresh actually but right now show you guys how things work and when i receive reset we’ll render and we’ll make a variable i already have it right actually this inventory list i’ll delete right now that’s for the next tutorial and we will we will input from pen erase all We will drag our block where is our block and we want this we want to show and now this lock we want to drag it to the corner about the corner negative 232 negative 176 we have these updated positions we wanted to go there we will set height to Pick random i’ll say 5 to 10. so now we can see just what it’s doing it picks random from five to ten well that’s obvious and we will repeat and we’ll get the height variable and this is basically the height of how tall you want your blocks so Actually this will this will only be the stone so you want want to cut down three from it so two to seven and we wanted to repeat height we will switch costume to stone and we will stamp change y we will change our y by our block size So the size of my block is 16 by 16 so i will change our y by 16. so now what we have is stone and after this we want to repeat repeat about let’s say two times switch costume to dirt and we will duplicate this stamp change y by 16. And then we’ll switch to costume brass and variable stamp so now you can say all of this you can say see this our dirt is actually coming at intervals between so the reason behind this is because our repeat it’s switching to costume stone and then it’s switching to costume dirt But it’s doing the stone only one time so we want this to repeat height and take this off put it think like this so we could have our dirt is generating and now we want to put all of this in the repeat loop let’s repeat it 10 times and We want at the end we want to let’s see this is negative 176. we will change x at right at the end change x by 16 and we will set y to negative 176. so now what we have here is making our terrain but now right now We can see our terrain is generating but it’s not random you will repeat this 50 times you can see it’s not completely random because it’s generating a completely straight terrain and we don’t want that we want like some curves and it should drop down so and we’ll first we will hide And we will just take us if it won’t work if we take a set height to pick random 2 to 7 again because now you can see it we have these really steep things so the best way to do it is set height to take a plus negative one and one Set height to height plus pick random negative one to one so you can see it the like trenches here and these speeds they’re all just one block above their surroundings so you can see well this is actually pretty satisfying to watch but if you want it if you’re not patient enough to Watch it so you can put on the red screen without refresh so you can see our terrain is generating i’ll make this like five to let’s make it five to ten because yeah we don’t want the grass to like so now here we have it but what so now I will duplicate the stone costume and i’ll call it cool and i’ll make a call so well i’m just filling out the stone texture with black so what we can do is switch costume to pick random two to three so now what it does it adds coal in here but it’s Way too often this is hurting my eyes it’s way too often so we can just do pick random to pick random two to three so that just increases the rarity so we can we can do this again if you wanted to even more rare because we’ll fold there so we have coal Running randomly so we can even do we can even add iron will duplicate coal and i’ll fill it with the peach color so we can even add iron in the mix here i made iron so we can pick random two to well i’ll make this four because we can have iron And it will be less rare but if you want even iron to be even more rare we can set it to pick random to to pick random two to four so now iron is even more rare but i don’t want it to be that rare i want diamond to be that rare Okay i won’t dive in that dryer not iron so i i’m calling this iron and i’m calling this diamond i’m filling this with a nice bright blue like this so here’s a diamond and we will pick random two to pick random two to five so now a diamond should be added I don’t know time well this is like way too rare right now pick random two to make it five here so now diamond is nice and rare so you can see just like two blocks we get of diamond and all in all it’s pretty good so we can even add trees So that trees we can just do this i’ll duplicate the grass and this i’ll call it tree and what i’m going to do is make a like fill it with trees of the color of tree brown and i’ll use the set the brush size to five and I’ll make this a bit lighter to give a nice speed pattern and i’ll just oh there’s our tree block well that does not look so good but that’s okay so i’m just going to duplicate this block and i will set it to appear and i will select this much i don’t Need it so we can now add some leaves so all i’ll do is just fill this stuff up now i’ll paste it again so i can fill all of this with the green oh not so dark oh that’s good so i filled most of that with green and i’ll give a lighter color To these parts and there’s our tree leaves so now i will set this on top set this over here and make sure that your all this stuff is aligned properly so just pasting some needs to make a tree so here’s the tree that we have so now right after our grass You want to switch to cost we will take an if statement and here we will put switch to question 3 in here take an equals and we’ll put one in here and we’ll take pick round of one to ten is equal to one and then we will switch to costume three Yeah so now if we do it then we can see that tree spawn so you can see how all these whole trees so that’s it for today’s tutorial and bye Video Information
This video, titled ‘Scratch 3.0 Minecraft-Style Terrain Generator!’, was uploaded by SkillsforFree on 2020-09-05 12:44:50. It has garnered 3935 views and 69 likes. The duration of the video is 00:14:07 or 847 seconds.