 Hello there team welcome back to game dev academy I am the Shane and if you want to let me know you're here then leave me a comment down below Say something nice or put your League of Legends username down below and I'll beat you a teamfight tactics I'm getting really good at that anyways in the last video We got the game over text to come up on screen and in this video We're just gonna be kind of finishing that off polishing it so that game over happens in a bit more of a state that we want To so we'll just reset the game instead of ending it and we'll also make it so that no new balls are spawned So we don't want players still being able to fire a ball when game over's happened. So let's do it We now have a game over state set up for the game and we are communicating that to the player We'll leave in the message on screen for a little while and then we're having the the application quit And what we're gonna do now is just make that game over State the actions that we do it game over a little bit better and we'll start with making it so that no new balls are spawned once it's game over Just because it will look better and to do that. We're gonna go into the paddle the player paddle and That's because this is where spawn ball is happening and what we're gonna do is set a condition on this So that the ball will only be spawned If game over isn't true So what we need to do first of all is get the game mode and as we've done in previous blueprints We've not got it as a variable here. So we'll set that up So up here on begin play before I do a new ball I'm gonna get game mode and I'm gonna make that a variable. So we'll do cast to game mode and that's gonna be our BO game mode just to spend every other time and Under object we want to do get game lovely and then as game mode come out of here And we're gonna promote that to a variable and we're gonna call that very old game mode Let's get rid of the space shape. There we go And we're just gonna set that up there and then we'll do new ball so Let's comment this up a little bit. So this little area here is Getting the game mode and that gives us a new ball. I don't need to comment. That is it's already there So now here we have access to the game mode So what we'll do is go to the game mode And we'll get it and then out of that we need to get the game over variable We really need to know if it's true or false, don't we and that then is gonna feed a branch So let's get a branch and our condition of the branch is is it game over? So if it is game over we actually don't want to do anything so I'm gonna disconnect this So I'm gonna hold alt and just click on that wire and we're only gonna move forward in this script if that is set to false If it's not game over we can spawn balls But if it is no sporting no balls x-ray on the ball day think that's right, so That's pretty good. We've got a check on that now what we want to do is make it so that the game resets Instead of quitting and that's in our game mode. I believe yep, so we're currently set to quit game I don't want to quit anymore. I want to reset the game I'll do that by just loading the level again, so after the delay. I'm gonna do open level and Here you can type the name of the level and we can see here that mine's called level one And you need to get this typed exactly right so capital L Evel and then the number one for me and that should work So let's compile that make sure that I compiled my paddle as well, which I didn't save everything And we need to give that a test So I'll just cut out the bit where I lose most of the lives and then I will see you when it's time to lose the last life Okay, so here's the last life. So what we're hoping for them is That when this life loses no new ball spawns and the level after five seconds will reset So game over's there no new ball. Let's reload the level There we go. We've got a game guys Okay, so That's kind of it then for the nuts and bolts of it to get us up to the kind of prototype stage now We've got something that functions as a simple breakout game What that means though is that going forward we can spend a little bit more time on making this pretty and then some new features So if you cast your mind back to step one I showed you that we're gonna have a bit of a castle will have Walls that we can knock down the balls gonna be visible when it goes behind things It's just gonna be good So moving forward it's gonna be the fun stuff or the things that I think are fun Not that this hasn't been fun, but everything's just been black and white and boring. So let's make it more beautiful. Ah Yes, let's do that Right any road. Thanks for watching. This has been great so far and I will see you in the next step. I Believe that quality education should be available to everybody and for that reason all of the classes at game Dev Academy are completely free And we're supported by our very generous school governors over at patreon If you'd like to become a game Dev Academy governor and support our work as well as helping us to steer the channel in the Right direction then use the link in the description to be taken to the patreon page