 Hi everyone, in this video we are going to look at how to find something to change in the mini console because that can be quite tricky. So we thought that we would just run you through a change that you could make so that you can get familiar with the process and hopefully make some changes of your own. So if you're watching this video, it means you've probably gotten up to this step here when you need to find something to change. And we've given you all these links here, so potential things you could change in the game, like a background color, shape color, circle size, and all of this is from this processing.org slash reference. So as you can see, if you have a look at the files, I've got them here in Visual Studio. You can see that these are all Java files. So all of these games were written in Java and actually initially they were written in processing. So processing is a Java library, sort of like a sub-language of Java, I guess you can think of it that way. But it's a visual Java, so it allows you to draw shapes and move those shapes, have a background and it creates a window for you to have those shapes move around and that's how they've created the game. So you can see we've got some circles, those circles are filled with this color. So it is a bit tricky to have a look at what to change when you're not familiar with the language, which is why this reference page for the language can be quite helpful. And we've linked to some that we think might help you under here with these links. So say you want to change the background color, it's got some instructions on how to do that, which should hopefully be helpful. What I'm going to do, so you've either got your code set up in Visual Studio here, or you're working on the Pi, which means that you'll be editing it in Nano. I'll do it in Nano just because that's a lot trickier than using Visual Studio. Hopefully you're not having too many issues with that if you're using Visual Studio. So I'll just have a go at having a look at the code in Nano. So I've got my own fork, I've got a demo fork here, I've done all the setting up, which you would have done in all the previous steps, so that's all set up. So I'm at the same point that you would be when you're trying to find a change. So what I'm going to do, we gave you a suggested area to make some changes where the student work is. So let's try and get to that section so we can use what we learned yesterday using the terminal. If we want to have a look at what's in this directory, we can have a look. So I want to go to source so I can CD into source, have a look at what's in source. Student work, let's have a look at that folder. Awesome, okay, so there's lots of these. You can see some of them are classes, some of them are Java files. So we want to be accessing the Java file. So a class file you'll see with a lot of them say with the box carrier one. The box carrier one has a Java file and a class file. The class file is just the Java file compiled. So when it compiles, it compiles it into a class and then it runs that class. So you might want to, well hopefully you've had a look at the console and you've had a look at some of the games. Perhaps you've got a favorite one that you want to have a look at. One that I liked was the Rocket one. So what I'm going to do is I'm going to have a look at the Rocket one. And actually I think maybe we should run it just to get some inspiration and see what we want to change. So I want to compile and run. So I've moved into the student work directory and I need to move back. There I am. Awesome. Okay, so I'm going to have a look at the Rocket one and I'll think of some things to change. So as I'm playing the game, I can see that we've got a flame down here. Maybe I want a blue flame instead of a red or an yellow flame. I've got a window here that's blue. We'll take a note of that. Maybe that's something I wanted to change. And maybe I want to highlight the color of the ship. Maybe I want to highlight it. I don't know whatever color I want. So those are just some ideas. So maybe you want to have a go at playing a game. And they're just noting little things that you might want to change. I'd recommend steering away from changing big shapes unless it's, I don't know, you can change these to squares or triangles or whatever you want. Just minor changes like changing the color of the window or changing the color of the flame. So I've got some ideas. Now the tricky part is finding where that is in the code. So if you've chosen, I mean, most of them should be pretty good. But this is where it's handy when programs have code comments. You can maybe search for a code comment in the file. That will tell you what each of the shapes are doing. So if it's a shape for the flame, if it's a shape for the window and so on. So what I'm going to do is I'm going to open the rocket file in nano. So I'm going to go back, let's remind ourselves where we are. So I want to go into source and then student work. And I want to open, where is it? Rocket. I went past it. So remember it's rocket dot Java, not rocket dot class. Rocket dot class is the compiled version of rocket dot Java. So I'm going to go nano and then rocket dot Java. And here we go. That green is really awful. So this is a bit tedious, this part that we want to have a look through the code. And hopefully most of the time the variable names here are quite informative. So it's very obvious what this variable or this array represents. It's the meteoroid shade or things like star exposition. That's pretty informative. So let's have a look at what we can change. So we want to have a look more at the drawing side of things. So we can see here we've got something that's a start screen that's running. We've got draw stars. So if you wanted to change the stars to, I don't know, let's do something simple. Let's change the color of the stars. Say we want the stars to be pink rather than white. Let's go have a look at where the draw stars function is. So there we go. We finally found the draw stars function. It was quite far down. So it took a while to find. And you can see here that we have this whole big function dedicated to drawing stars. It's right at the end. And when we had a look, if we go back here, we saw if we want to change the shape color. You can have a look at that. It's the fill function. And you give the fill function our color code either in gray scale or RGB. You could even give it a hex value if you want. And then that will change the color of the shapes below it. So what you might want to have a look at is a color selector. And you can decide what color you want your stars. So at the moment, we can see the fill is 255, which is white. So I don't want the stars to be white. I want the stars to be, let's do a very bright yellow. Great. So that color code is around about, well, let's just say 255, 250. Well, yeah, I'll take that code. And then I will update it. Great. So we've made a change. We want to save that change, save that. And I've exited nano. So what we want to do after we make a change, you want to double check that that change has worked, which again can be pretty tedious, but it's important to do so that you don't carry on with your work. And you might have changed code that didn't do anything. So it's always good to double check. So we compile it to compile it every time. Because the rocket class file hasn't changed. The rocket Java file has changed, but it's what it was initially at the moment. So we need to compile this Java file again. So that it updates this class file with the new color that we've added. So let's compile and run. And we can head to the rocket game. And let's see what color our stars are. Awesome. So you can see the stars are now yellow. So we've made a successful change, quite a small change, but it's always good to get started with something pretty simple. So you've made a change. And what you want to do now, if you're happy with that change, is you want to move that from the workspace into the staging index. You want to stage that change. And then you want to move that as a commit. So if you were using Visual Studio Code, it's a lot simpler. You can just scroll through. You don't have to navigate all the way down one bit by bit to go through the code in Nano. You can just edit it here. And you can open a terminal window down the bottom and run the same commands that we were running just in any regular terminal. So you can do everything that we're doing in this terminal window. You can do a Visual Studio Code. So what I want to do now is I want to commit. So we've got some instructions on that. You can work your way through those. But if I do it really quickly, we can have a look at what files have changed. So we can see that the rocket file has changed. If we want to check what we changed, just in case we made any strange changes that we didn't want to, we can use the diff. And all of this is in the workshop walkthrough. So you would have run diff. We can see that you've made that change there. Looks like we've made that change there. Don't worry about that. I had a look at it and it's not an issue. So what we want to do is move that change. Like what we said in this diagram, at the moment it's in the workspace. We want to add that to the staging index. So I can add a file individually. So let's have a look at status again. And let's go git add. And we'll add that file. Awesome. So when I go and check status again, we can see that that file has been staged. It's a stage change, which means it's in the staging index. So the next thing we have to do is commit that file. So we want to move that to the local repository. And we do that by making a commit. Again, this is in the instructions. So don't stress too much about noting all this down. It's all written down for you. So remember with a commit, you want to write an informative message that explains exactly what the changes that you made in enough detail that people can look at the commit and say that's exactly what that does. But not too much detail. You want to keep it pretty concise. So what did we do? We change color of stars to yellow. I've committed that. When we check our status, our working tree and our staging index should be empty. And if we check our log, we can see that we've changed the color of the stars to yellow. So that commit has been put to the top of our commit history. So that's the process of finding a change and committing and moving it to the different stages. So hopefully that has been straightforward and you're able to go through that process. I think definitely the hardest part will be finding a change. And it just takes a bit of patience and going through some of these reference pages will definitely be helpful and give you ideas of what to look for. And perhaps if you know you want to change the background, you can just do a command F and find all the background. So you can see here that the background is zero. You might think, okay, what does zero represent? So I said before that if it's one number, it's in grayscale. If it's three numbers, it's an RGB code. And if 255 was white, that means that zero is black. We can double check that. We can go grayscale code zero. There we go. So we can see that the grayscale color for zero is black, 255 is white. So if I wanted to go back in this and change the background to, let's make lots of changes. Let's make the background pink. You can see it's a lot faster when you're in Visual Studio. Let's see if the background has changed anywhere else. No. Save and change the color of the flame. So I can see here that we've got variables for the flame colors. So let's have a look at where the big flame color variable is. So we can only see it four times. And these are the two places where it changes color. So what I can do, I can change my big flame color, medium and small. So I'm going to change it to a blue sort of flame. So I'm going to do, my big flame will be a really light blue. We'll just make that the same. Although there's a little bit different, isn't it? Okay, I'll just make them the same. And then we'll make the medium one a little bit darker. And the small one can be a very dark or very deep blue. Okay, so we've made a few changes here. It's good to keep a note of the changes that you made so that you can make sure that you look out for them when you compile and run the code. Because if you've made a change and there's been no impact or you can't see any impact, it's good to remove those changes because you don't want to just change code unnecessarily. Okay, so I think that's pretty good. You might think, I don't know, maybe you want to do one more thing. If we head back to this year, there's a line width option. So maybe we want to change the width of the lines. And that is stroke weight. So if we go back to Visual Studio and search stroke weight, it's come up a few times. And this one's under the comment that says Rocket Details. So I'm guessing that these ones have to do with the main shapes of the rocket. So that might be something we want to change. Where else is it used? There's a few sections. Okay, the Rocket Details comes up twice on line 510, 5.05, then 5.30. So why are there two rockets? Oh, it's an else. Okay, so you've got if banking left and game isn't finished, so this is if the rocket is tilting left, draw it like this. If the rocket is moving right, draw it like this. So a lot of that code is the same. It's just the positioning of things. So we'll need to change both. Oh, so there's three. There's this else. So if it's left, this if it's right. And this I'm guessing if it's straight. So they've got a no stroke here. So let's make it so that when it's going straight, there actually is a stroke. The interesting and perhaps we want to play around with our stroke weight. We'll make it five so that it's super obvious. And we've done it in here. So let's just go compile and run. And let's see what the changes were. So what did we change? We changed the flame color and the stroke weight when it's straight. There's one more thing that we changed. Oh, that's right. The background that is very pink. There we go. So the flame is blue. But it doesn't seem that the stroke weight has had any effect that I can see. But all other changes were successful. That's pretty good. But because the stroke weight didn't work, I'm going to go ahead and just delete those changes. Just in case it makes any issues later on. I don't want to change the code unnecessarily. And that's where the diff tool can come in handy safe. I forgot before what changes I've made. If you want to check what changes you've made, you can use the diff tool. And it will tell you exactly what you've changed. There we go. So it's telling me I've changed my background. Let's just make this a bit bigger. Just too big. So you can see I've changed my background. I've changed some flame colors. I've changed this here. And as I can see it, it hasn't had any effect. So we're just going to go ahead and remove that section. And it will tell you what line it is as well as 538. I'm already there. It's handy. So I added this, it says. And it just had a normal stroke. It wasn't commented out. So I can fix that there. And let's check the diff again. Awesome. And so it just has the changes that we want. So again, you can go to that same process. First we should check that. So get status. Good. We've just changed the rocket file so I can add that file. I'll just do an add all because there's only one file. And then I can commit. So there's a few things that we did now. We don't want to make our commit message too long. So we'll keep it pretty brief. So I'll say change or update background and flame colors. And so if we go and log that, we can see how two most recent changes have been added to the commit history. Great. So that's what you want to do when you're looking for changes. Have a look at some of the other programs. They'll have a little bit different styles. I think the rocket one was pretty good because it had a lot of comments that were very informative and told me exactly what each section was doing. Most of the other programs are pretty good like that. Others have less comments. But yeah, just have a look. Have a look through this page here. Have a look at things to change, particularly the ones that we set out for you. They're probably the most straightforward ones. There are some complex ones here that most people don't use. So I'd recommend just sticking to them. But if you're interested, you can have a look at others. So yeah, good luck, everyone. And I hope you can make some cool changes.