 Our mission is to create a solar system model to scale, and we're going to be doing that using scratch. It's going to be a digital one. In the last video in this series, we went over to NASA and grabbed their planetary fact sheet. We imported some of that data into scratch, so we're going to get ready to use that. Specifically, we're going to blow up and travel down our planet so they're all in a relative size to each other, and we'll display that on the screen. And if you're a teacher or homeschooling parent looking for some solar system printable worksheets, then I've got you covered. Go check the description for a link to those. But let's get ready to scale up our planets in just a sec. Hello world, it's The Serving Scratchy here, teacher, server programmer, and I help curious learners just like you along on your learning journey. This video is part of a series on creating a solar system model in scratch. In the last video, we went and imported some data values from a NASA fact sheet into a list. Go check the description or the card in the top right hand corner for a link to that one. In this video, we're going to be creating some variables and some sprites that represent our planet. So I'm going to be using this diameter data. So let's get stuck into it. The first thing you notice with our diameters list here, we've got one, two, three, four, five, six, seven, eight, nine. We don't really know what these mean. So what I reckon we should go ahead and do is create a new list with the planet names. Before we create the list, I'm going to do a step before that that you're probably going to hate me for, but it's going to be great down the track when we're organizing this file and to reduce our debugging. So what I'm going to do is create a variable for each of the planet names. What do I mean by that? All right, well, let's just right click on this variable. We'll rename it. We're going to go all caps because it's going to be a constant. Then what I'm going to go ahead and do is go up to the backdrops. And when the green flag is clicked, we're going to set Mercury to Mercury. Now this text value, it doesn't really matter what you want it to be. It could be that nice capitalization there of Mercury or it can be all caps, whatever. We're going to go ahead and do that for each of the planets. Okay. So I've gone ahead and magic all these variables and map them to their names. You can just refer to the fact sheet to get the order. But here's how I like to remember it. So I like to start with Earth because that's where we're on. And I know the planet before Earth closest to the sun is Venus. And the one after it is Mars. I know the first planet closest to the sun is Mercury. I can just memorize that. And I know the last one all the way out there is Pluto. So to remember the stuff in between, which I personally find the hardest, is to think about MJ. So I know Jupiter comes after Mars. And I know MJ, that can be Michael Jackson or Michael Jordan, or some other memory device that you can use to remember MJ. And then I know what does MJ, Michael Jackson do? Well, Michael Jackson would sing. So I've got the S there for Saturn. And then I always get confused with Uranus. Yes, it's Uranus as well. But yes, I'm going to call it Uranus in these videos. And Neptune, I get these like mixed around. So I use Saturn here to help me out. Because when I spell the word Saturn, U comes before N. So that will give me the order of Uranus and Neptune. Now, obviously know that Pluto, our dwarf planet, that the end of this queue. But hang on, weren't we creating a list of all the planet names? Well, that's what we'll go ahead and do now. So I'm going to create a block for this. And I'm going to call it generate planet names. I'm going to generate planet names after we've set them all when the green flag is clicked. Give ourselves some space here. And yeah, look, this is a little bit painful, but we are going to go ahead and do it. So I promise you that this will significantly reduce the chance for errors in our project if we use variable names over string or text. So what are we going to add it to diameters? Well, we're not going to add anything to diameters. We're going to create a new list here. We'll call it planet names. So we want to name things to reflect what they actually hold. Good practice to just do the order here. Mercury to planet names. Let's duplicate. Cool thing is you can just right click on these. You know that Venus comes next. Let's duplicate them. Right click on Venus. Change it to Earth. Let's just duplicate those three blocks. After Earth comes Mars and Michael. Then we have Jupiter for Jackson. Do you know what comes next? It's S for Saturn. Okay, I'm just going to duplicate these three blocks. This is Uranus for the U in Saturn. And then we have Neptune. And lastly, we have Pluto. All right. I'm just going to blow this back up. Give ourselves some space here. The last thing I want to do before we add planet names is we want to delete all the values first. So we're just basically creating a new copy. Because if we don't do this, we'll keep adding to this list over time. So let's click the green flag. And boom, we've got all of our planet names in there beautifully. And now that we know all of our diameter values here and any other data that we import will be mapped one to one to our planet names. The indexes or the indices, they mean the same. Now we have our names. We have our data. It's time to create some planet sprites. Now you could just create one planet sprite and use clones. That's going to be a fairly complicated solution for what we're doing down the track. So we're just going to create a single sprite for every planet. Yeah, there's going to be some duplicate code in that. But that's just the trade off of simplicity. Okay. So let's go ahead and create our first planet. I'm not going to select now for this one. We want to make sure we're on vector. And I'm going to zoom right in. Getting it nice and close here. And the reason I'm doing this is because we want to create a tiny planet. And the planet that we're going to create is the planet with the smallest diameter. Do you know which one that is? It's our last little planet there. And it's called Pluto. Cool. So I'm just going to draw a really small circle and put it smack bang in the center. This is going to be our reference sprite. We're creating it this small because this is when size is 100%. And for the other planets, we're going to be changing the size of this sprite by the attribute of it. So let's rename it to Pluto. You can change the color. I'm just going to leave it purple for now. I'm just going to hide our lists there. And let's get Pluto in the center. And I don't know if you can see this. I'll zoom in, but there is a tiny little dot there. That is probably too tiny. I reckon I can blow this up a little bit bigger. I'm just going to hold the Alt key down on the keyboard to make it resize from all edges. And that dot is going to be great for our purposes. You can sort of see it and it'll give us enough room to move for our biggest planet, which is Jupiter. Okay. Now that we're back over here in Scratch, we're just going to go when the green flag is clicked, let's create a new block, call it set size. And let's just call set size as soon as the green flag is clicked. And what set size is going to do, it's going to blow up the size of the planet, not the planet, but the size of the planet to the relative value. And we're using Pluto as our standard, as like the number one. What we'll need to know for this, it's just some basic percentages and ratios. I'm just going to jump across to Sketchbook to explain that a little bit more in depth. Okay. So over here in Sketchbook, I've just got our name Pluto and I've just represented Pluto here by this dot. And we're saying that Pluto is going to be equal to the number one. So let's just say that Pluto's diameter was 80. Okay. We're going to use Pluto as the baseline. So what does that mean? Well, if we want to create the number one, all we need to do is divide 80 by 80. Okay. What this looks like essentially is we're taking Pluto and we're dividing Pluto by Pluto. And now it looks like a division symbol. So this is the size of Pluto and we're just dividing it by the size of Pluto. And that's going to give us a result of the number one. This might be looking a little bit funky. Okay. Let's get another planet in here to understand what we're talking about. Okay. So now we've got our largest planet, Jupiter. And I'm just going to draw a nice round at Jupiter there. Fantastic. So Jupiter is the largest planet in our solar system. And what we want to do is we want to find out how many Pluto's would fit inside Jupiter. So what is the relative size of Jupiter to Pluto? The way that we can do that is dividing Jupiter by Pluto. Okay. So we're taking the size of Jupiter and we're dividing it by Pluto. And what this is saying is, okay, how many Pluto's go inside of Jupiter? So our number values, they might look something like this. Remember, we're just saying 80 as a base value. We know that Jupiter is a lot bigger. So let's just pretend this is like 9,000. So we're saying how many Pluto's go inside this 9,000 number here. Now if these numbers are too big, let's just reduce them to make it nice and simple. Okay. If we've got the number two and we divide that by the number one, we're saying how many ones go inside of two? We know that is equal to two. Okay. Because two over one, that's just two. Any number over one is just going to be that number on top. Now you're going to use a calculator to figure this one out. Essentially, this comes to 112.5. Well, this is saying we can fit 112.5 Pluto's into Jupiter. And that's if these values were correct. And we could represent that visually if we would go ahead and fit in 112 Pluto's and then we would need a half one in there. But essentially, this is our formula and we can abstract that out to something like this. We're going to take the planet diameter and we're going to divide that by Pluto's diameter. And that's going to tell us how many times bigger this planet is relative to Pluto. And with this in mind, we can use the size attribute in Scratch. So let's jump over to Scratch and implement this. So now that we're back over here in Scratch, we can use our lists to help us out with the maths that we need. So remember, we want to end up at a division where we've got the diameter size going over Pluto. So we need to get the diameter of Pluto. And this might seem a little bit confusing at first but this is how I'm going to go about it. And head over to the variables category. I'm getting the item number of a thing in planet names, okay? The thing that I want to get is Pluto. So now you can see I'm using the variables that we've created here as opposed to trying to find this direct text. So this is going to give us a value of nine. With that in mind, we can reference this number and use it to extract the value of the ninth place here. So we can get the item of Pluto in our diameters. And if I click this, we should get 2370. Boom, and that's what we have got. If this is a little bit confusing, just rewatch it because we're going to be using this throughout the project. I know that this refers to Pluto. If I duplicate this and I right click and I want to get Jupiter, that's all I need to do. I just need to change the variable name. And there we go. We've got the diameter of Jupiter. So the last thing I need to do is just put these blocks into place where they need to go. Give ourselves some space there. And when I click this whole block, it's going to tell me how many times bigger Jupiter is than Pluto. So Jupiter is around 60 times bigger than Pluto. We can use this value to blow up the size of our planet. But I'm getting ahead of myself because we're still in the Pluto sprite here. So let's just change this back to Pluto and we'll get the value of one here. Because remember Pluto divided by Pluto is just equal to one. Now we want to set the size of the sprite. So to do that, we're going to go ahead over to the looks category and we're going to set size. If I just make this a little bit bigger, we're saying that this is our standard here. So this size of the planet is equal to 100. This is our number one. So we're going to get a multiplication operator and just put in 100 there because that is our base value. We're saying that this code block multiplied by 100 is how much bigger the other planets are going to be. Now this is currently equal to one. So when I put this whole block into our set size, it's just going to multiply 100 by one. And that's just going to end up at 100. Now for Jupiter, it's going to multiply 100 by 60. So do you know what the size is going to be? We'll check that out later in the video. But let's click the green flag and you haven't seen anything because we're still at 100. But let's just change this now to 200 and you can see that our planet got a little bit bigger here. We'll click the green flag and it's gone back down to 100. Okay, what I'm going to go ahead and do now is just duplicate this sprite for Jupiter and modify these code blocks and then I'll leave it up to you to do the rest of the planets. I won't do that in this tutorial. So let's duplicate Pluto, rename the sprite to Jupiter. You can see that we've just inherited the code blocks that were in Pluto. You can go into the costumes if you want and if you sort of want to zoom in and make this planet a little like Jupiter. So I think Jupiter's kind of a little bit more orange like and you think even Jupiter has that little spot on it too, doesn't it? So you could even like create a little spot that's going to get heaps bigger. Okay, let's jump back over to the code and the only thing different that we need to do now is instead of setting the numerator to Pluto, we're going to set the numerator to Jupiter. Okay, and you can see Jupiter over here on the stage, tiny little dot. I don't even think I can click and drag that because it is that small. Oh, look, I got it. That's cool. I'm going to drag Jupiter down the bottom there, press the stop sign, press the green flag and boom, you can see how much bigger Jupiter is relative to the size of Pluto. It is huge. Now, remember, this is just a model. It's just giving you some indication of the sizes here. It's not perfect. It's just a model based on these values. And you can check down here in the size that our size has blown up to 6033. So what I'd encourage you to go ahead and do now is duplicate this Pluto sprite because this is our base sprite, our like template and do the same thing for the rest of the planets and you can feel free to go into the costumes and change the colors and even put some rings around satin if you want. But that might mess around with the sizes of it too. Let's see how you go. In the next video, we're going to make a digital model of the distances between all these planets, which is a little hard to do on our small stage here and scratch. So we're going to be using Google Earth to help us out. Okay, just before I leave you, I just want to show you that I've gone ahead and duplicated all these sprites and changed the variable names. And I've also just put a dark gray, nearly black background here on the backdrops. I've gone ahead and played around with all these. Now I put rings around all the planets that have rings based on the fact sheet. Bear in mind that that the larger your rings are, the more walked your planet might become. For instance, if I go back into satin and I just change the rings, you can see how it kind of looks a little bit funky. So you just have to play around with something that looks visually okay. There you have it. These are the relative sizes of all the planets in our digital solar system. As you can see, all the distances aren't what they should be. And we'll do that in the next video.