 Hello world, it's the surfing scratcher here bringing you another video connecting the world of maths to scratch in this video We're gonna be hatching a plan to give the user some feedback as to what type of move their balloon has made So get comfy. Let's get stuck into it. Okay, so here we are back in our scratch project We're just picking up where we left off. That's a calculate num imager to move now We need to shift our focus to getting some feedback to our players when they make their moves So that's through some animations and that's through what the bat says So I've just got a little document that we're gonna read through to help us understand what we actually need to do So I'm just gonna switch across to that now Okay, so our goal is to give the players some feedback on the type of move their balloon made We'll do that in two ways through the text using the bat sprite So subtract a positive. That's exactly what's happening here and through animations on each player balloon So this particular animation we are getting rid of negatives because remember sandbags refer to negatives We're dumping negatives. So we're taking away negatives. Our balloon is going to lift these Two boxes don't relate to each other. Just so you know that Recall that there are four scenarios that we must handle. There is the scenario when we've got a positive operation such as addition we Also have a positive integer. We will have the addition operation. We'll have a negative integer We'll have the subtraction operation. We'll have a positive integer. We'll have the subtraction operation We'll have a negative integer. So these are the four scenarios that we need to handle for our game Now I'm going to switch across to the planner and take you through how I will go about doing this Okay, so here we are in our scratch planner with our stage with our bat sprite activated and with our Things that we can use to help us code this So let's just step through this list and then I will take you through the English that we'll use So we've got our operation variable that we should be familiar with with previous videos We know that it can be either the addition symbol or the subtraction take away symbol We know we now have the number of images to move so the number of images to move it can be between negative 10 and 10 if you recall so I might just pop that down here just so we've got a little bit of a reference point So that can either be negative 10 or positive 10 Okay, just put a little comma there Remember we calculated that in previous videos. We've got the custom block say move type and that's located in the bat sprite That's why we're in bat sprite here And I'll show you that in the next video We've also got at our disposal some of these custom events These are the four events that we will use to account for the four scenarios mentioned above So that's the positive the addition positive the addition negative the subtraction positive and the subtraction negative Here they are Connected, but they won't be in a scratch project So what what these mean that these events are actually going to trigger the animation So the animations are already happening in our project like they're all set up Ready to go, but we just need to broadcast messages to tell them when they need to animate So this will be the best place to do that Okay, so I'm just going to go ahead and hide our explanations here Okay, so the starting point for this plan is I'm going to use a technique called branching And we did branch a little bit in the previous video, but here it's a little bit more visible In our code we have two stages to pass through once our deal button is pressed We have the operation and the integer See if you can use the boxes below to organize these two variables to account for all of the four scenarios Okay, so in that previous video we Use the operation variable first and then we Checked out the integer After that and that gave us the number of images to move Okay So now we've only got these two variables to help us So the four scenarios that we can have Well, we've got two scenarios where the operation is either An addition symbol or a subtraction symbol. So I actually just pop those directly if I get the right layer selected And I actually just put those in here. So there's our positive scenario and there's our negative scenario. Okay And we know that our number of integers to move. Well, that can either be a positive integer So that can be a positive integer Or it can be a negative Imager as well Okay, so if this is our operation Our operation and then this is our integer Remember our integers can be either positive or negative and they Can be positive or negative. So these are out four scenarios scenario one Yeah, this this combination scenario two this combination scenario three this combination scenario four this combination So these are the four things that we need to account for and that's all of our event scenarios right here So I've got some english sentences that I created earlier Now, let's get the first one of those up on the screen for us to fill in the gaps Okay, so let's just read through these blanks. So if the variable is equal to Then if the variable is greater than then broadcast and say If the variable is less than then broadcast and say Okay, lots of gaps here Might be a little bit confusing to begin with but we know Some things that we can pick out straight away is These two these two things relate to each other. Okay, so think of this This block of english referring to say The scenarios here Okay, that's where I want you to think first. Okay, so it's sort of saying if the variable Is equal to something let's think about when we are dealt some cards we First check what the operation is. So if the variable operation Is equal to positive Sorry, it's equal to addition Great, then we want to check if the variable Well, we've only got one other variable We're not going to check the operation again number of integers to move So if the variable num integers to move I'm not going to write them all out is greater than greater than okay Greater than what then broadcast a message and say something else Okay, so the cool thing about broadcast is that's giving us a clue We've got over here our custom events. So we know that this next fill in the blank is going to be one of these So we know that we're already in the addition scenario. So it's we can already rule out our two subtractions So that leaves us with add negative or add positive. So if the variable number of integers to move Is greater than Well, what number might that be? Let's think about it. If we are greater than zero Well, we must have a positive integer if our number of integers to move is bigger than zero greater than zero We've got a positive integer. So we would be adding a positive. So I think We need to be greater than zero. We would broadcast the add I'm going to be broadcasting the add positive And then we also want to say add positive again. So I'm just actually just going to put plus plus there but you would say um You'd actually type that in to say add positive because that's going to be the feedback that our back will give Okay, cool. So that's the first First condition that we've actually taken care of. So that's the first one The next one we want to account for is this one. We've got a positive or sorry An addition operation and our integer is negative. So if the variable number of integers to move Is less than zero because we know if we're less than zero there's zero. We're less than zero. Well We've got a negative. So we're actually going to be adding Why are we adding? Well, we're inside The add part of this one. We're inside the add. So we're going to be adding a negative and that's going to be Adding a negative. Cool. So we've actually just accounted for the all the positive Sorry, all the addition operations. Now we want to account for the negative One. So I'll get that up on the screen right now Okay, so I've duplicated our English block and just prefilled it with some of the variables So I didn't need to write it again to save you a bit of time Okay, so when our operation is equal to the subtraction Then we want to check it the number of integers to move So if the number of integers to move is greater than zero, so it's a positive number We know for that to happen when our operation is negative We have to be taking away A negative because remember if you take away negatives you actually end up with a positive number and that's what we're doing here Our number of integers to move has been positive. So we have taken away Actually subtracted a negative here. Okay, so this is our negative negative Okay, so then when we jump into Our next variation if the variable of number of number of integers to move is less than zero So now the number of integers that we need to move is now a negative number We have just taken away a positive number. So that was zero. Take away the positive. Okay, so we're actually subtracting Sub positive now Okay, we're subtracting a positive. So Take away a positive number All right, I encourage you to just look over this block again All right, and just maybe rewatch it a couple of times because I can I can see how it could get a little bit confusing Okay, so that is the end of our planner here and the next video We're actually going to be translating these English blocks into scratch ones That's all for this video and in the next one We're going to be translating out English sentences of the plan back into scratch blocks If you like this video give it a thumbs up and if you want to stay connected to when I release more content Make sure you hit that subscribe button. But until then I'm off to go find a way. Take it easy