 So in our digital scale model of the solar system we just use Google Earth to plot out the relative distances between the planets on a location that's familiar to you. Now we're going to use that Google Earth imagery to take some screenshots and import that across to scratch. When we do that we can create a view in our application that will show the user the relative distances and they can click between the planets. We'll also create a seamless transition between the planets so it looks a little bit neat. And if you're a teacher or a homeschooling parent out there searching for some solar system printable worksheets then I got you covered go check the description for a link to some resources that you can use with your group of learners. Okay get out your desktop camera and we'll get stuck into this in just a sec. Hello world surfing scratchy here teacher surf programmer and on this channel I help curious learners just like you along on your learning journey. This video is part of a larger series on creating a digital scale model of the solar system so go check the card in the top right hand corner now and some links in the description for more info if you're just jumping in at this stage. In the last video we plotted all these placemarks onto Google Earth and all these placemarks refer to the planets in our solar system and they're all sort of relative we'll scale them down. Now what we're going to do is go through each of these planets and take a screenshot and we're going to import them into scratch so let's go ahead and do that. First up you're going to need some sort of screen capture tool. Now I'm on a Mac there is a built-in one where you can go control command shift and the number four at the same time and that's going to bring up a little window where you can size it and the cool thing about it if you look where it says Pluto here we can actually get the dimensions of it as well. So I'm not going to take a screenshot using that way I'm going to use quick time player and if you're on a PC and you're not sure how to do it just press print screen and you can open it up in paint and resize it. So I'm going to be using quick time I'm just going to open that up okay my quick time player is now open and I'm just going to press control command and n and that's going to come up with a screen capture. Now I'm going to capture a selected portion of the screen and there's some various options here that you don't really need to worry about. The main point is that you're going to resize this window and I'm going to have it around about 860 let's just say 870 by 615 it doesn't really matter but this size is pretty close to proportionate size of the stage on scratch that's what we're going for here so once I'm happy with it I'm just going to press capture and it's going to open up in preview and then I can just save that into my files and you can see here that I've already gone ahead and done that so I'm not going to waste your time by stepping you all the way through that but that's what I'd like you to go ahead and do is he's just jumping into this tutorial check out the link down in the description that links you to this particular Google Earth map you can check out the table of contents go through each of the planets and take a screenshot as you work your way through each of the table of contents I'm going to assume that you've gone and done that and I'll see you over in scratch okay now over here in scratch and if you're not familiar with this file there's a link down below in the description where you can go grab this data project okay we're just going to paint a new sprite here and we're going to upload all of our costumes let's just see how we go by selecting them all sweet that looks like it's going to populate them all in their forest I'm just going to go click on that top one and we'll delete it cool so now that we've got all of our images here and they're all in the same location that's great we're just going to center it on the stage I'm going to change the x to zero and the y to zero and now it's pretty much smack bang in the center and that's what we're looking for here let's go to the sun view and back to our code let's rename this sprite to planet distances eventually we're going to be able to click the planets and it will navigate to the relevant costume so what I mean is these planets here and it will navigate to the correct distance but we'll do that down the track what we want to do now is create the animation that will make this happen and here's what I've got in mind I'm thinking that if we're on a costume we want to go to another one we're going to pixelate this current costume then we'll switch the costume number after it's pixelated and then we will de-pixelate the costume so it looks like there's a transition between the two so I'll show you how I'm going to go about doing that let's create a custom block and we'll call it transition to costume we're going to add an input like to put a colon and I'm going to say costume number cool then head into the control blocks let's just repeat for 10 times at the moment and what we're going to repeat so we're going to change the pixelate effect let's just do it by 20 at this point great so let's just click this and see what happens all right we've got that pixelated animation there that's not what we want right now but we know that works so let's clear the graphic effects after we've pixelated we want to change to the costume so let's switch the costume to the costume number that we specify in here great and then after that you want to grab another repeat block and we're going to change the pixelate effect by negative 20 we want to reverse what we've done let's go and clear those graphic effects again and now let's check out that animation there we go we have transitioned but we haven't actually changed the costume because we need to call this so right now our costume number is on the sun because I just put it on the sun and if I grab out this code block and we transition to say the third costume check out which one that is that is venus let's see if that works and now we're on venus ace okay let's bring these planets to the front and make them clickable and that'll round out this tutorial let's go to the events when the green flag is clicked let's go to the back layer and we'll also reset the costume to the sun so let's click the green flag you can see all of our planets are here at the start we're not going to worry about resizing repositioning them at the moment we just want to get them clickable at this stage we're going to test the Jupiter planet here because it's the nice big one so what we need to do is grab a when the sprite is clicked block we're going to use some variables and events to help us out that if you're a bit fuzzy on those go check the card coming your way okay so when this sprite is clicked we're going to actually create a new variable here and this variable is going to be called selected planet and the values of this will be all the planet names here again another handy reason to have all these planet names as variables so when this sprite is clicked we're going to set the selected planet to Jupiter because we're currently on Jupiter and then we're going to broadcast a message and we need to signal that the state has changed or the selected planet has changed so so selected planet has changed you always want to name these things to reflect what they do so now I'm going to grab this code block and dump it on Saturn and this is where having all the individual planets is not so great but we're going to right click and change it from Jupiter to Saturn so now I should be able to click between these two and see what happens so I'm going to just drag down Saturn just so we can see what's going on and if we head back into our planet distance sprite we can receive that event so when we receive has selected planet changed we can grab our custom block and then what we want to do is we want to find the index of that costume so if we jump into our costumes we can see that it's not a perfect mapping because Sun is actually number one Mercury would be one plus one Venus would be two plus one and why am I going two plus one well we've got a list down here of our planet names remember so Mercury is one but in our costumes it's actually two so we'd have to go this index plus one whatever the index number is plus one okay let's jump back to the code so what we can do we can get the item number of the planet names and what we're going to pass into that is the selected planet because we've just set that then we need our addition operator and we need to add one to it awesome so now we can grab this code and place it into our transition to costume now if I click Saturn you'll see that we just transition to Saturn it's hard to see there you go if I keep clicking it we'll keep clicking to Saturn as well we can fix that later now if I press Jupiter see that we've transitioned to Jupiter so we can click between the two planets and we can see how far they are obviously we're obscuring the view here and that's not ideal but we're going to leave that for a later video because that's a little bit more complicated and I want to introduce a simple state machine to help us out with that to create some modes for our application for now you can go ahead and dump this when the sprite is clicked on each of the sprites and change the variable to reflect the planet name that it lives in okay let's just quickly fix that bug where you click the same planet and it transitions going into that is duplicate this code block because this is giving us our current costume number that we want to transition to if we go to our looks we can grab the current costume number as well now if these don't match then we want to allow the transition but if they do match we don't so what we can do is we can grab a comparison operator and say we can check to see if the current costume is equal to the target costume and if it's not we can wrap our custom block inside of an if statement and that should work so now I'll click Jupiter and it's no longer transitioning it's executing the code but we're not transitioning I'll go over to Saturn and boom that's working as you would expect so we'll leave this tutorial here in the next one we're going to create a simple state machine that's going to create some modes so we can have different sizes of our planets depending on what view we're looking in and this will set us up for future videos of creating orbits and that kind of thing as well if you want a taste of that I've got a card coming away in the top right hand corner now on a video that I've made on a simple state machine so go check that out beforehand I'll see you in the next one