Hello and welcome to the second tutorial the caucus to the Flappy Bird c++ series. And in this part we'll be looking at how to create scenes we'll be using the source code from the previous part of this series if you have a if you don't have a Dory there'll be a link in the description. In this policy we will be creating scenes which will serve as the building block for the game. We will be creating for scene which are glassing many scene, game scene and game obviously, obviously, depending on how you want your Flappy Bird or even your game in general, they will change your main or have certain scenes, or you may not have or you may have more scenes, and chances are you probably weren't in a complex and this last scene for me will be the HelloWorld scene but rename and refactor to splatting because we just created a project sounds dumb go ahead and open up what we've got.
So first of all is going to go to where the hello world scene is located. rename this to splash scene last name must have thought this D and our default okay? But the math on low or not certainly do like say we factor it so it's going to go down from the top and see what needs to be changed this needs to say slash within this column right here, the change class name to splash scene we named HelloWorld in here to splash scene. Get rid of this menu Koba don't mean this class enough CPP worker we don't say splash enough age changes to blushing Copy and Paste anywhere where Hello with located replace it with blessing. And what we can do is get rid of this method entirely, we got rid of the declaration. And inside here we'll get rid of all the code except for the top few line basically is just checking if delay has been initialized, and the screen size and the origins we'll be using this for positioning.
Now that is done. We're going to build it make sure it's still building successful. But we have a failure. Okay. The app delegate we need to rename this this is where it says what seems to be wrong and then we can change it down here to discussing build it now. is a common mistake successful Yes, it is indeed.
So what we're gonna do duplicate that rename that to Main Menu scene. paste this over to spelling correct. And I was gonna duplicate this one and we'll also need to duplicate the header. I'm gonna call this game scene. Okay The and rename this to Game Over scene. Obviously there's nothing wrong with you just creating fresh headers for CPP and recoating all itself but because we're using scene that's built into Coco's to the clan, a lot of it is generic or the bare bones are generic while there's copy and paste and rename a few things as days a little quicker, and I find it helps prevent errors.
Just add these new files to our project in the same manner, that We did before click finish and I just need to go through each one a file so do Game Over scene first rename last thing to gain on the school over copy and paste this and this will change to Game Over theme and every game obviously and then rename this to Game Over seen this change anywhere where this classic game oversee and now let's go to games into us do what we did there essentially okay again copy and paste this actually in here Did I rename it done that I did indeed change this to okay scene and after changes to game scene right here, go to game scene into the game scene header. Rename class into game scene in here as well. Now finally go to Main Menu remains to main menu again these hash is not defined hash define can be named wherever you want just make sure they unique because they prevent the file from being included multiple times which will prevent which will cause compiler errors, because you'll have classes and variables and whatnot with the same name.
So let's just rename this to Main Menu. See and find common basic, the common basic three times in here. Rename this now if we build it, we should get a build successful at least I hope so. Go to my success folder and run it as well. really shouldn't be anything on the screen but let's make sure it is running successfully without any errors or any crashes There we go. It is now running successfully that is it for this part of the series, we will look at how to create team credit as seen many many seen the game team and game have seen all of which are self explanatory.
In the next part of this series we're going to look at implementing this policy. If you have any questions feel free to message us or support us on our systems Koto UK, email will be in the description you can comment on this video or just direct messages via YouTube, or the recording for source code will also be in the description. And as usual, thanks for watching and I hope you have a great day.