 So you want to recreate the gameplay from Flappy Bird. Not a problem. Last month we finished our intro to Unity programming series, so none of the code that I show here will be new. Today I'm just gonna show you how to put together the code you already know. When our player hits the wall and we die, I'm gonna use our basic explosion prefab, which is just a sprite that grows and becomes transparent. And in order to help us hear what we're doing, we're gonna use two basic sound prefabs that will make a noise when we jump and when we successfully pass through an obstacle. Okay, here we go. So if we look at a few videos, the first thing that I noticed is this game constantly only moves in one direction. The obstacles are always the same distance apart and the open in between where you have to go through is always the same distance tall. So let's start there. Here's a basic 3D grid object that I'm gonna use for the floor, and I'm just gonna give it a simple red glow material. And right underneath we'll create a cube and make sure that the collider is set to trigger, add a rigid body without gravity, give it a tag called environment, turn the mesh renderer off, and now we're gonna parent everything to the hitbox and drag it down here to turn it into a prefab, then create a new script and drag it onto our floor. And the only thing that this script has to say is move in the Z direction at this speed and kill yourself after 20 seconds. If we save and run the game now, that is exactly what's gonna happen. Great, now we need to keep sending the environment until the player dies. So let's create an empty object on the other side called sender, create a new script, drag it to the sender, and all this script needs to do is constantly send new environment when the old ones have passed the player. So the script literally just saves every 9.9 seconds, create a new floor at this location, and if we go back into the inspector and drag our floor into the sender and play the game, now you can see that as the old floor destroys itself, new floor is being created constantly to replace it. Okay, that takes care of the environment, now we gotta send the trouble. And we're gonna do it pretty much the same way we send the environment. Let's create a cube, drag a basic red glow material to it, tag it with the environment, set the collider to trigger, give it a rigid body with no gravity, control D to duplicate it, so we have one for the top and one for the bottom, and we'll duplicate it one more time and change the tag to checkpoint. Turn off the renderer and put it in between the walls so we can successfully reward the player for passing through. Parent the whole thing to an empty object, drag our movement script on top, drag it down here to make it a prefab, and now we are ready to send it to the player. So let's create a new script, attach it to the sender, and it's gonna be similar to the environment generator, but instead of sending stuff every 9 seconds, we are gonna send it every 2. Now here's what's different. When sending the floor, we always created it at this location. However, the obstacle should be sent randomly between here and here. Looks like the low is gonna be 0.68 and the high is gonna be around 2. So every 2 seconds, right before it sends an obstacle, it's gonna randomly pick a height between 0.68 and 2, move to that location, and then create the obstacle there. If we save and run the game now, then you will see that we're basically done. All we gotta do now is add controls to our brave main character. So create a new script, drag it to your character, and all this needs to do is constantly move the cube down. In the original game, it looks like the speed of falling increases exponentially. So we are gonna use alert, and every time you press the space bar, it's gonna give a small positive value and make a little jump noise. Out here, we're gonna set the constant negative speed to 0.13, and if we save and run the game now, that's exactly what's gonna happen. But as you can see, it goes through the walls, which obviously is cheating. So to stop that, make sure that the collider is set to trigger. Create a new collision script, drag it onto your hero, and in this script, we're just gonna use the basic collision into code and say if we touch the environment, destroy ourselves, and create the explosion where we died. Otherwise, if we touch the checkpoint, make a checkpoint noise, and you're done. That's literally it. This whole game is six pieces of code, a floor, a wall, death, and two sound effects. Obviously, the next thing you would do is make a GUI so that you can see the score at the top, and you'd probably wanna make a menu to navigate through the game, but I haven't really shown you guys how to do that yet, so we're gonna leave it here. Hopefully this inspired you to realize that you can make really fun stuff, even if all you know is the basic. Again, thank you so much, everyone, and as always, hope you have a fantastic day, and I'll see you around.