Building Unity Game From Scratch: Flappy Bird | Magic Coding | Skillshare

Building Unity Game From Scratch: Flappy Bird

Magic Coding, Game Developer Sensei

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
15 Lessons (2h 12m)
    • 1. 1

      8:32
    • 2. 2

      13:19
    • 3. 3

      7:29
    • 4. 4

      6:25
    • 5. 5

      4:46
    • 6. 6

      7:11
    • 7. 7

      7:16
    • 8. 8

      6:56
    • 9. 9

      14:47
    • 10. 10 Ui 4

      11:06
    • 11. 11

      9:21
    • 12. 12

      8:22
    • 13. 13

      11:42
    • 14. 14

      6:11
    • 15. 15

      8:51

About This Class

As most of you know Unity Game Engine is one of the most popular game engines used in game development.

It doesn't matter if your a beginner or an advanced game developer information in this course will help you a lot throughout your career as a game developer. Developing awesome, stunning, commercial quality games on a variety of platforms in the latest version of Unity 2018, plus with this knowledge and logic, you will be able to make games on your own, which is pretty amazing right?

The point of this is to take to the level creating your games on your own from scratch, so from Game to Game, you will get better at approaching to making your awesome games.

 

Transcripts

1. 1: What's up, guys? I'm on here. And as you saw in the previous listen, a radio, we're going to create our flappy birds, but decreed that we have too great a new project. So open up your unity and it will say something like this. Like if you do not have no projects before you'll see that there is our products on your disk. This is in the cloud. Or maybe you will be even in the learned have. But we're gonna skip this and just click on the new right here so we can create a new project. And then we're gonna choose the name for our projects. I would call it that. Be that bird's bird G. And then we have to do the templates of this game. I mean, my project. Meine says it's two d. So click on the template and choose the two D these vernacular bother For now, we're not gonna teach. Todd will be teaching those for now, So I'm gonna click just template to deep that you will choose the location where you want to put. And if you want to change change location, you can always click on these three dots and change the location where your project gonna be. I usually always put them at the projects. I keep all my projects there, the immunity analytics, maybe on offer you if it's off and continue to quit project If it's on, turn it down. I mean to be off and off course clicked Pretty project so we can create our project. Once we open up our unity, you will wait a bit for it to be created. Once that is done, you will see that we have automatically create the sense bowler with our sample seen. So go ahead and take the sample seen by right Clicking renamed and rename it to game play. Sing like this. Then you can see that my interface is a bit different maybe than yours. I mean, I have animation animated time. You know the drills. I mean, probably you know where to go through a window. And then you have here animation or animator added, and you can drag it wherever you want. Everything here can be dragged. Put it out anyway you want, and when you're satisfied, goto they out, save it, make sure to save it. I mean, is your preferences collect the looking off mind, then save it is mine and get desperate bait. So the only thing I really want to talk about the unity engine because I think I've showed you everything I think I know. I showed you everything Is that in game, then goes here right below the game. Have pre aspect and resolution for 80 by 800. If you do not have one and name it, however you would like. It's called like portrayed mode on the phone and you can check that out filed build settings and when you switch platform to enjoy to enjoy you switch, then you will see here we have a lot more about more resolutions. I showed that in previous videos we can show you could check their videos that our previous periods but premium reviews off previous mill use so enough that we're going to go to folder that you will see at top left will see something like resource is available with the blue banner on it. And there you will see you have collected bird assets and Flappy bird complete project. Then you will take out don't want assets, of course, and take out assets and put them inside of the unity. So this and then we will wait. Still, unity loads that up. Once we have imported our assets that I gave you Continue have our farm. So this will use in you I when it comes to adding text and such, then we have our seems okay with that's not in the acid have our sounds. So this is the sound Whenever we die, this is whenever we jump. And this is whenever we got past two pipes. Pretty amazing, right? So we're gonna use that plot in scores for that. And then we have our sprints. And for that, we're going to click on the Android if you want Teoh over. Jeff were android. This is for the, uh, this for RS. My bed is for Android, and this is for Pat B. C. Max at Mac and limits. So Daniel could for overdrive, So, like the next size to be able to this we just 5 25 20 You do not want to get past this, so keep that in mind. If this were, like, 5 12 by 1000 something yet then you will go to 1024 and you will. You'll actually search for the largest number here, and then you will find it here. If it's like 1000 let's say 500 then you will go for 2048. So give that in line. Then you will go to format and then press RGB a don't you bid and hit. Apply So you live scenting here. So click here to overdrive Matt size energy be eight and two bit If it if you want for P c , Max and Lennox, you will choose that when your own depending. On what? Well, I mean, not what, but where you want to build it. Once you're done with that, we will have our backgrounds. You could, Jake. You can choose from daylight and night flight, so I mean, it does not even matter. But I'm gonna put their lives because that was in deflect birds. And then you can see we have a problem that our background is not covering the whole screen . And what is right to fix it may be able to think off to skillet up. I mean, that could fix it, but skilling up our project and one quick tip if you want to scale it up, done, just drag it, hold down a shift when you're doing that. So it goes equally. So hold on, Chip. And it goes equally. And I mean, that is somewhat of a logic thing to do. But Skilling up our what's called getting up our assets can hit its performance. So in this case, it did not. But let's say we add our flappy bird. What's this? Not but example when something else that's very obvious, Bluebird. And if I put here 100 100 let's see on the Why it's it it lost. It was a some resolution to it. I mean, we could put it out because it be 10 by 10. As you can see, it's kind of bored out now. Another way to fix it is to change this to size and boss a one a one a one one a 2.1 and then to scale down our cameras size. So here I can go in type in two point you and our background matches perfectly and even for our assets to exit t to scale it. Now if something just second So if this was like a few big solicit. We started off with this highs off our problem assets. It is okay to scaling down so that I will not hit any performance or everything, or it will not blurt out. But to scale it up, so is it can hit it performance and it can cost the blue out. So the resolution on the asset will not be at good as it was before. So there you go, go to main camera, change the size, and then we're ready to go for important, important our assets. Now, one thing I will change it just just to be Jane on Biggie Daylight on this and leave it like that. As I was saying, that does it for this video. Still, next time, Amar and goodbye. 2. 2: Welcome back, guys. I'm are here. And today we are moving our with Dr B Birds. In this video, we're gonna add our animation and our players to the game. So let's get started first, viewable to assets and create a new folder. And doesn't the animations like this inside the animations room? Great. Another folder are sub Colbert and call base Flett Bird. So birds and it like this and go back to assets. Go back sprites and inside for strike two inches. You want the Bluebird Rather bird or what other world we have? Let me check on. Don't have blue, red and yellow or orange so you will choose from them personally. Gonna choose the blow birds. So is elected all of threes private you use inside. So first right second sprite and third spread over the bird and altogether Put him in here it that way we instantly create animations. You can see you safe types and I'll go back to assets, animations, birth and him and I'm gonna called is just birds like this. And when you go back to assets, you nations birth and we have our Bloomberg great controller of animation controller not gable filler, and we have our bird animation. Now I'm gonna change this name, not the Bluebird, but to burden on Lee. So like this where I'm going to college lap Ebert. And once I start the project, you will see that animation is running Azanian Sea community. Yeah, and we have a problem. I'm gonna fix it real quick. As you see right now, we have orders in our order in later. So I'm gonna add sorting, layer our backgrounds back grounds around like this, and I'm gonna add layer lay Lear and for the back room I'm gonna add background. And for the threat separate bird. I'm gonna add player there. And right now we have visible are birth. And now when I start our game, you'll see that animation that are bird is running. Everything is too fast, too slow. I'm going to show your work Tip how to fix a goat animator Click on the birds So click on the second bird Good animator and on the bird And here you can set the speed if you want to be faster people going 0.5, for example. And when I start you will see that our animation. It was pastor. It was faster. I put something like 0.7 goes slower when eight This. But I think one is for the good and I'm gonna leave it at one. So that would be our animation for the birth. So or inside the enemy that you can choose sprite length so you can click on it and change it. But I recommending the animator way genic only the speed that is recommended now for our bird we we need for our birth have our circle collided to be Let's go to seem and to see how our circle Cliven look like. So right now it goes out of the way and we need to fix that. So I'm gonna skill downgrade reduced, like this gonna change off, said void with lower teach up our radius again like this and I'm gonna leave it, get zero man. Not yet, but it goes a little bit out of the circle and I do not want that. I'm gonna put a big down. So this looks perfect because we're not gonna actually catch with this part of our body were going to get by nor with this side over here maybe this, but not so sure, But if you want it, you can move out of the way or you can add. So if you don't like the circle for whether you can always add the box the light of TV and then change it up by cleaning on edit collider and inputted, however you would like. But I pretty much like the circle more because our birth is kind of circle. Think so. I believe it is a circle, or you can at a polygon collider, which will catch perfectly. I mean, you can scale it down to get perfectly. There's but polygon a little lighter, and then you can change with these lines over here to be as perfect as it could be. But that's a lot of work for only the collider. I mean, I will not bother with that too much because our circle collide. We will do that. It will do its 10th and the force. I'm gonna say what our circle either is for is basically to collide with pipes, coins or no coins, but score when we hit the ground, hit the ceiling and so on. But for that we have to put are certainly going to be a trigger now, once we put our circle I to be a trigger we need had a rigid body so it can detect that is a trigger because when you put a circle collider or any collider that has a trigger, it will not be have if one of the object does not have rich body. For example, if I had here a pipe if pipe or bird does not have a rigid body, trigo will not be activity to keep that in mind when circle either's or ethical weather is not working. All this check it had rigid bodies. 11 of the gate objects. So at component level, add Bridget body to be now for the rigid body to d. You know, when you put about attacked the dynamic arberg out automatically start falling city because rigid body applies physics. To put the big kid cinematic, it will stay in Mom plays. And I think I went this over 1000 times, so keep that in mind now. We didn't live are rigid body to be dynamic because we want our Burt to be falling and now to fix the falling thing so we never fall again. We have had jumpy on jumping Would have to co debt Now let the assets and click on right Click on the assets Great! A folder called Scripts. Now, inside the scripts bullet we're gonna Gates sub folder called Let the Birds Birds And why am I always look like this folder or sub folder? Because keeping your project organized helps a lot when you're working in teams were working solo when you come back, The project after a long time and everything is is that it's place to know. What are you going to search? We're going to search it. We're gonna find it and all of that stuff This will be needed later on, OK, to see a sharp script that I'm gonna call it Bird scripts and birth and I'm gonna add our bird script. R B bird just really proved composite. Once that is that I'm gonna go down here at Component and I'm going at our bird script now . Once that is not off course, open it up in visual studio Orman developed. But how would you have or whatever you prefer now inside our bird script? Of course I'm gonna believe this comment and it's comin over here. And once I'm done with that, I'm going to start by typing in public floats. I could public load and very gonna type in jump force like this, and I'm gonna live it with that right now. Above here. I'm gonna add private, rigid body to G that I'm gonna call it my body like this. And yep, So that will be it. Now, inside our starts from you're gonna change your toe awake because when I'm calling out things like like my body, my body ridged body, I like it to keep it inside of the week function. So go ahead and typing away functions just like but is down. You do not have to do that. It just like my preference. In a way. We're going to say my body equals tooth, get components on it, and we're gonna get our rigid body Badee ud. Now what? This means we're gonna get word your body duty, capital, average body do the for to whoever has the script on. So in this case, are bird has script, meaning that we're getting reference to this which is partly over here, that inside the update function. We're gonna type in here. Another function will be are void. Uh, lapse. Avoid laugh be I'm just going to jump jump movement I want called Let the jump, woman But I think I'll jump movement or by movement How, however you would like and I'm gonna call it inside are the function jump movement, open parentheses, then sound my color. So inside off our jump movement, we are gonna type in here if then we're going to check If we get input that get mouse button down, forget most button down. And now we're choosing, which might want about zero means left, like one lease right click. I'm gonna put zero Say means left like or so at this rate bars mean Or if we get input dot get key down. And then we've been taking key code space decode space. So either if they click down left leg work risk piece on the keyboard, we're going to make our birds jump. So we're gonna type in here my body that the loss of vision loss pit equals two. Director New no equals to know that active to dot up multiplies by jump, forced to jump force from this. So we never expect either or my Mars button down zero betweens left the core space where you're going to jump. Now, if you remember, I talked about this. When we're using rigid body, we have have but it's recommended to change fixed basis. Fixed of it. You can live it out, get it, will seal. It will still work. But it's recommended. When you're using which bodies to use it in a fixed orbit. I'll go back to you. Indeed, our script is attached. And now when I start up our game But of course I forgot. We have to change the jump for us because it zero nothing will happen. And we're gonna change that. Not to be zero, but again, I'm gonna start with six. I use it 3.5 for now. Maybe that Yeah, that I didn't that work. So I test out. No, I mean was press space junk. Instead, we are jumping and it is working now. Everything too much you can always be. But this you can jump around here. Let's say three go back. Where is our birds way Rebirth three and so on. So as this had 3.5 works out for me. So I'm gonna leave it at 3.5 for now. And that is how we're making our jump bird. So we're melting, multiplying record to that up, Which, exactly? Actually, zero when it comes to X And why one when it comes to why multiplied by three point thought makes our bird jump big makes it, makes it the lost thing. Go up. So it's a teat is dropping as it's supposed to be jumping, of course. And our animation goes perfectly. And so you guys, that will be it for this video. That is how we're gonna make our bird jump and until next time I'm out here and goodbye. 3. 3: Oh, what what? Some guys I want here and I'm back with another video and this one we're gonna change our bird rotation is you could see what now we are jumping through that is working out for us. But our birds days at one motion I mean, yeah, it is moving its, uh, what's called wings. But that's how what I'm talking about with the Jumper one, it's had to go up, and when it's called it, we want it. It's had to go down now go back to scripts Flappy Bird and opened up our bird script. Now, before we do that, one thing we have I mean I forgot is our circle clutter has to be not a figure but off trigger because we want to collide with the ground, meaning that when we talk our around, we want to stick into it. We do not want our bird to be falling out, falling out and not be seen anymore. So we'll see that true. Just are just figure to be off and open up our bird script. Once we are inside off our bird script reading, typing here public float and you have our rotation up and we'll have our rotation down because speed, those two will not be the same. And then we'll have our Vector three, which will be half our bird rotation like this so publicly. With tradition. Operation down and back to pre birth rotation now in nothing before back to three or any variable automatic automatically recognize it as a private backer. Three. Singing with Better tree or part back to three. He does not matter now, below our drop moment I'm in adhere void fix burned rotation like this, expert or fish. And here we have our flu upload degrees. So not to easy praise. And I spell that right e t is grace to ads and agrees to add zero. We're gonna check if our my body don velocity dot Why less or equals 20? Then we're going to say degrees. The increased at it was too negative. One multiplied by rotation. Now, if my body are the Wallace steep, my body was that y is greater than zero. The Americans say degrees at equal salutation off. Now here to not put negative multiply by making you want. You can just preservation out to be as a start I mean is starting to be negative and then a ruble nets have to add negative one multiplies meditation down. But if you want to read irritation out to be positive inside of the unity inspector, you will have to add the snake. They multiply by one. So I'm living. Is this petition domination up? And he will have our birth rotation. Equal Student knew of active three directed three zero for the X zero for device. But Z is what is going to be changed. A pregnancy, Matt F not clamp. It's a regular clap clamp Rotations E with our bird rotations are Z multiplies by degrees mammals by the plus degrees at no minimum value for that will be negative. 90 and maximum will be 30. Next will be 30 and minimal being negative. 70. So when you go back to anything like on the flight of birds, this is the max Are minimums this negative 19 community. But this is the maximum that will go minimum and the max will be 30. So, like this, I went to put 45 45 is too much I put here. Let's see. Dirty game in 15. You would like you were going to test this out later on. Now, once all that is that we have to add transform Dodd Eller angles. So this will change rotations. They were gonna change to be for interpretation like this. Now way have to add our voice updates off date and really put inside of update function are fixed bird rotation like this. You keep it inside the fixed update. But we're not using any off the lost or actually are your checking if our but just checking it. So we're not actually using it, changing every just detecting if I ever lost the equals zero, which is kind of better because we're checking me checking. Get every frame. Not every proof. A few frames were just pretty good. So right now when I start our games, you'll see are really want anything because our reputation down invitation up our zero. So we have to change that. So validation up, even safe for and for the rotation out on a team negative for so they should be sixth an imitation that will be negative for, So check it out. So, yes, it is working So right now for not satisfied you can always put irritation out to be, like 10. It was faster vision down. Native fifth five. I mean, on 50. So I'm gonna just right now, I'm going to give some ideas. We contest out, you know does not build faster enough. Excuse me? Are moving up or damn, it is tilting its head. So he had that big it. I mean, you can put the same values for the forced off for traditional permutation down. I mean, it's up to, but I like to keep it. That petition up will be more likely or faster to go up. There are rotation down, and right now, I'm just actually that human in fixed update forward the same way as inside of update. I mean, I think our people bore work even better. So not things with only update, isn't t. It is kind of the same thing. So I'm going to put it inside of update and leave it as it is so traditional big 10th rotation. That will be negative for, and yet that will be it. That is how we changed rotation. That depending on what are we doing? So you were falling down. We're going to change rotation of arbor to go down. If they're going up, we're gonna change a bird invitation to go up or to be increased. As I said, that would be it, guys. Still, next time, Amar and goodbye. 4. 4: What's up, guys? I'm here and I'm back with another, will you? In this one, we have created everything as you can see for our flappy bird, We can jump. We have the adaptation and jump, but our birth is kind of static. And when I say static, it's not sitting in one place. But it actually is when it comes to X axis. So we are moving on the Y, jumping up and down. But we're not moving on the X access. So we today we're gonna do that. Now, go ahead, open up our bird script. So open up, and he we're gonna add our publics at public. Another float, which will be X speed so regularly is our XP. When we are changing this, the access on the X when it comes to our birth. So for that, he's gonna be pretty simple and call this void X movement like this. And what kind of movement do we want for our flappy bird? Well, as you know, in the game, we can jump up and down, but we cannot choose the speed. How not how, but how fast we want to go left. All right. So that is not what we depend on. So our movement is going just to go forward, which means right And we're gonna choose. Do we want to go up and down? So that is kind of movement that we want. You want to move our ex access or are exposition on forward meaning in this case, right to the right. So let's go open up our results to do. And we will do that by adding transform dot position opposite position like this. The lust equals twos. Applause cycle suit. New effective too. You acted too, and were going to say time that smooth delta times dots You doubt the time multiplies by EC speed XP than coma and and zero. So we did not want to change our position to be When I want changed on the y axis just on the X and told my bet. Put here dot fact of three and then odd, Add another zero or there is no need to you. So as I was saying, dressing up position plus equals two new at the time that smooth out time multiplies about XP and then we're not gonna add or anything on our why? Because we have our jump movement for that. So you see, you were plus equals two meaning that are transferred position will always change up on our X axis. And we have to add that our updates are call this X movement like this and let's go and test out. So I'm gonna a bit left because we don't have our camera follow, and right now it will not move. I forgot. We have to change their values. So let's say for our X speed, I'm gonna put it do. For now. It can be slow or fast. I'm alluded to that. Take it out. So it's not actually that. So I don't see one. Let me test again. And is it that you are moving the right side yet? One can work out. We are going to the right side, some even more left so you can see it one more time. It's very moving to the right and we can choose who we want to go up or down because you can see right here now, depending on you're on your when you do want to put it to be faster, they want to be slower. I'm gonna put it one more time stores. You can actually see that we are moving. I mean, you just saw that. But that's doing anybody's TV are moving this this time it's too, so but it is moving. That is what we need. So depending on XP, change it, however we would like, it's up to your preferences unglued at one. And yeah, that will be it for this video. Now you can see we are not following our flappy bird Army camera, so it our birth is going out to the bounds. So I'm gonna end it here and start a new video so I can explain you even that. So that's it for this one. Until next time I'm are and goodbye. Now, I'm just gonna move it a bit to the left, so you can see that are, but it's actually moving. And for the speed, I'm gonna say once X will be one, and when I start off our game, you will see that our bird is moving to the right or forward. It's conceived, but right now we have a problem that our bird gets out of the bounds, so I'm gonna start would store it big down so I can show you one more time that this script is actually working. So depending on the value you want to be, you want our bird to go faster or slower. You will change the X speed off course. It's logical to think that way that if you put a bigger value like three, it'll go faster. If you could lower value by exurb 25 it will go slower. Now, I'm gonna leave it at one because that is working out for me. We'll see. I think I will not change our game, but yeah, that will be it. As you can see, our birth is working out. We are changing our chance from that position, every frame for seconds each second because it's in Boyd Update and we're using the smooth time that all the time, which is actually a smoother, smoother, out time to adopt the time so that the time and doesn't type is time In seconds. It took to complete the last friend so you can live it a double time for smooth at the time . I prefer the smooth of time because, of course it's working out smoother and yeah, as I said that that will be it for this video. I'm Omar, and I will see you guys in the next one. 5. 5: Welcome back, guys. I'm out here and in this lesson I will be teaching the guys how to create a camera follows script. So, as you know, right now, when we start off our game, our bird is flying is going to the right, is jumping up and down, but it's going out of bounds. So we need to fix that. To do so will vote scripts and inside of scripts full. They're quite another folder. We're gonna call this camera script camera script. I call it scripts. But if you only had had even want to have one script which actually are camera follows fruits camera follow. Once we have finished adding R C sharp camera follows groups, open up. I mean, Cameron, Inspector Tab and add component, which will be our camera for like this. Now open that up in visual studio or model developed by double click on it. Now inside of camera follow it will be pretty simple. So the lead, the comments, you know that I think I did not have to tell you every time, but it's okay. I think it's OK and you'll have our privates private transform, and that will be our birds and we'll have our public flowed, which offset all said thanks. And I'm gonna play it, turn out to be as default 0.5 and we will see that we want to change it later on. Now, inside our start function, we're gonna changed awake because we're getting a reference for our bird transform. So type in here burnt equals two game object that find. And we're going to find our birds. Birds burn like this Capital B than our transform this. And then time I call some good unity and check Yo, it's not birth too Flappy birds of confidence and put it here. So, like this, it's not bird axe movements that has my video. It's actually left a burn again. Control city coffee. It's argument, right? Click it. Even I actually do control plus C, but I think it not work this time. Good job. Plus CNN control plus wheat based it down like this and we're searching for death Transform that inside of our update function we're going to see transformed. Our position equals two new actor Tweet Directive three and we're looking for the birds. God position that x plus the offset X and therefore the why will be zero and the floats They will be transformed out of position. That Z you can do a good our transfer position. That why? But it's not necessary. But for our Z, it is because if I change this to be alive zero when it comes to see access, I put to be zero is achieved, nothing will be visible. I'm going to get up. Knocking is visible. If I lived at minus 10 you can see our bird in our background. So right now I would everything down on my right. Yep, that's going out now when I start off our game it to look like our bird is standing in one place. But as you say, it's not because we are moving. And one thing is that we do not have our background normal. And why is that? Will basically our background stays outside off the main camera, so we have to put our background inside of the main camera. So it follows along with our player. When I started game right now we will see that it looks like we're standing just in one place. But actually, if I go to black birds. We are moving on. The X access now degrade the not the illusion but the great thing that we are moving, we will have to add the floor down and has to be the next video. So this form, we have created our main camera to follow our words. So I'm going to just that with the background quick and you will see that we are actually moving. But when I put back out in the main camera, then our back from zero stays with us all the time and it looks like they're not moving with, but we actually are. So yeah, that is how we're gonna create everything in one week. One sentence as I said that it guys for this retail till next time, Tom, Omar and I will see you in the next. We knew 6. 6: What's up, guys? I'm are here and I'm back with another whio in this lesson, we're going to add our ground to the play of slapping birth to D. So go ahead and create an empty game object inside of our Here are key reason it's transform. So recent 000 And I'm gonna name this around or actually floor someone in this floor that inside the R floor we've been gold sprites. Add grounds where our ground. I just find that we need to find our grounds. How are they called the political grounds from such up for ground like this and add one ground. The floor was right Now it's exceed our ground is not visible. So off course, what I'm gonna do is gonna tag background I m pretty to be as one we're actually remembered to be is to mis que so it's on top of our background and they will have another layer in our background, which will be one. But never mind. With that display, our backgrounds are ground to be in the background and put order in layer to be to now for our ground. Its position is going to be on the Y negative 2.25. This and our position on the actually be that when do so, this wouldn't do. Zero remained the same. I never got a duplicate Our ground with will be our ground one and change it on the Exide, which will be three point 57. So it matches perfectly and I wouldn't be too mean. Army camera will no not see the line in between were just pretty good. Now we have to add our flow to the main camera and we are set off to go to the script. So right now nothing will be happening our global state static. So it's not like they're moving as you can see life and nothing is happening. So for that, we need to add our script. So let's go to I said scripts. And we're going to create our around script like this, which will be our new you sharks critical car floor movement on this. Now we'll put that inside our floor. But before we put our script inside over the floor, we have to add, uh, what's called our boss. Delighted. So we're actually look necessary. I topple at our box, right But no, we're not. So I live like this or nothing. Just at four. Movement through it and open up our floor movement script inside our a little studio or no influence Lord Movement script. We're going to leave the comments and a start function, so that's not needed. And we're gonna have here are public flowed X bomb of this and inside. Our update here is what we're going to do. Well, basically, we're going to check, so we're gonna move our floor to the left side. I mean, the right opposite our birds to re great and that illusion not closure. But we're getting that are floor is moving, so it's going to be like this. And when it we just eggs bone with will be somewhere around here, we're going to go back and stop, start all over again. So you get my point. So let's go back and update. We're gonna check if our transform dot now in what the case we put in position dot Exe if that is lasting. Negative three point. That's a nine for now. F I'm gonna check it. I'm going to say X bone exposed like this, but position will not work because position is the position in the world space. And we will use our local position, which is actually position of the transom over the transfer relatively parent transfers to meaning that were left love relative to our main camera. So once that is that we're gonna see transform, transform dot position the opposition. But local position equals two new factor three. And that will be our zero when x Frandsen got position dot broke off just that local position God, why? And then transformed that local position z us rz right now is 10. Even our back row understand our floor because we are in the main camera which negative 10 antiquated but bounce in between have to produce to be positive that that is done But we have to create our movement for are what's called for our floor because right now we're just transforming our local local position to zero when it reaches the Expo. Now to do so, so less equals two or less nobody. Trance for that translates friends late like this negative time dot does the time and then 00 or the X and y so not a few zeros on one and yet desolate it now for arm expounds. Where's our floor? We're gonna turn it to the left side until will reach the end with the right at off our floor. So, like, this might just how many? How much army? Its 3.9, as I said. So we're gonna companies put it on the X mount and we already use to test things out. Now, if I start our game, you will see that our floor is moving and we're creating that lotion that we are actually moving but are back home is think in one place, meaning that it follows our main camera. But foes are birth to right now. Everything is working out. So yeah, that's it, Guys, for this video. I'm were here, and I will see you in the next one. 7. 7: Welcome back. Guys are here. And today we are moving on with our flappy birds. So in this video, we're gonna add up some pipes that some part of the pipe in our game. So what are we waiting for? Let's hop right into it. Personal. Create an empty gave object Inside. Off are here are key. I'm gonna need these pipe and I'm going to reset its transformed by clicking on these year button your icon and then click reset So everything will be 00000 and skill will be 111 by negative Now, inside of our sprites, we are searching for the green pipe down added angry Fight up like this now for the green pipe down and for degree Pipe up, select the boat So click on the either of them And then I mean one of them and then called out control control button on your keyboard and then click on another one. As for the sorting where he will choose background and you will put it to be order in layer one. So it's in front of the background, but it's below the ground. So right now when I move green pipe down. You can see that it does not go over over the ground. It goes actually behind it. Now, position acts will be only thing that will matter here and for our up. You're gonna see negative 1.73. But our re pipe down will be at Do you 0.70 2.7 70. Developed memory can add as months as many zeros you want. It will not change anything. So negative. 1.73 it will be 2.7. So this is the what Howard called. This is the the space that are bird has to go over. I mean between. And we're gonna add that India box collider so at no, this for the pipe down. So we're gonna add a boss delighted for the pipe. So add box glider to be this and then change it up to be right inside. Because whenever we go in between these two pipes, I'm gonna put it right in the mill. Whenever we go in between, we're gonna get, uh, a score and we're gonna play it to be a trigger. So make sure you do that. As for our being pipe down We're gonna actually add even here, Boss Provider, But hasn t It is matching perfectly. So no need to add things. Only thing that you can do is put it a bit lower than it is because as a giver, I always hate that I did not hit the game object. I did not hear it. I know it, guys, I just know what I did not hit any and the dame but I died. So for the sake off those kind of gamers, you can always put it a bit in said there are no excuses and I'm gonna do the same thing for the green by pop at Born in box Collider added it Put it a bit inside like this. Just a bit done. Don't overdo it. Just a bit on the top and the left or right side. Now, the next time I m been up, had some tags so at tax and it will are pipe score meaning death. We have got in between these two and we have scored and you'll have the pipe which will be when he hit. The piper will die and one more which will be our ground. So and bring this video where we have added the ground. We did not add the box glider, so I'm gonna do that right now. Box glider, click on edit. So it is. It's all the way here. I'm gonna put it down and I'm gonna skillet as our floor. So, like this, you did not have to do the whole thing you get. I mean, the Whiting does not actually matter. We can put it like this, but I am in a tag. Everything. As for our ground, it's not going to be a trigger even for our pipes down and pipes up. They are going to be on trigger. Not on figure, but not the trigger. So keep that in mind. And here I can see that I overdid it a bit town like this and gonna leave it right now, our script is above our box collider, and I like to keep all of my scripts and down here. So I'm gonna click on the gear, but I'm here and gonna move it down in our skip is moved. As for the pipe down, pipe up. You're gonna leave it set up just now. We have to save it. But to save this, we have to create a brief house. So go here, create folder, call it pre perhaps pre fabs and put it with our pipe inside of the prefab Spolar. We're not gonna have many are pretty facts. I mean, I think this will go. This is going to be on Lee Prefect ID we will have in this game. So there is no need to create sub folder sport. And why have I created the prefects? Well, right now, as you can see, I tagged the pipe score. I mean, I did. Right now I have tagged the pipes magnet. I'm gonna hit. Apply. So this actually applies. And let's say I Toledo's I delete those. And when I want to come back to them, I can always go to pre fabs, put them right down. And why is this useful? Because we re quit are spawning for the pipe. We have to attach this pipe gate objects and always spawned these gave object as for our pipe. So as I was saying that you have Yep. We have added the floor book whether we're just gonna tag with the ground, and I'm just gonna I really would really quickly check if we are not falling to the ground . So we are not supposed Yeah, like that. So this is how we're gonna look like when we die. Accepted? Our floor is going to stop moving. So like this And I gave you the stop. Of course. So, yeah, you must a be up. I must exit to save all of this control plus pass to save it. As I was saying, Yeah, that's it for this video. I'm not here and I will see you guys in the next one. 8. 8: Welcome back, guys. On March, year and day, we're continuing with our flappy bird. In this video, we're gonna add our spawn. Er so for dead, we have to add an empty game object inside of Army camera and called out its partners for this spawn. Now I'm gonna tag. Are Sponder with Icahn? Let's say this case, whether one is it there we have our Sponder. As for our sponsor ribbons point our pipes outside off the for the games. So that's a you 0.5. I think that's to work out and then go to scripts Great and folder or some fuller call. This gave lay scripts and scripts and inside of game place groups. Brigham at R C. Sharp political cults, Father. Now, as for our sponsor, we're gonna create a timer, uh, bounds. Where can respond are pipes aid. And then we responded. So not from me talking at spawn a script. You're responding game, object. And, of course, open it. Once we have opened up our spotter, our spine of script, we're gonna believe the comments here and here and at up some variables, the first variable will be our public game object. Just our pipe pipe Legos. Then we're gonna have our public float timer minimum and then timer maximum. And yet, that will be it for the variables. Now we're gonna go down. And at here are the numerator that is going to be called ponds on a flight. And here we're going to say yield, return to yield brethren new wait for seconds and anywhere the wait for time or minimum. The timer Maxim, that is, hopes my bed. But before he could do that said the medias and I pin random that range and you're ready for timer minimum or time of maximum, which Max moved. Spoke. So you're regretting a random rage. We just actually going everything around them float number between minimum and maximum. We did not have said them up, but you can do that later. Then we're gonna instead initiate hearings. It instance she ate our plight at new active tubes. You met to Frandsen. Got positioned on X. But why will be a Brandon dot range ran that range. So again, on women ads, Babic flowed, But not time or me. A timer minimum, but actually a minimum. Uh, why bounds minimum? And then why bound Maxie. It's around that range for by bound minimum. And why Browned, Maxine, that I'm gonna add coma right here. Food don't enter typing water, knee and that identity to get the to get there is a resolution, birds, irritation. And then I'm gonna call out our start over tea to start our spun pipe. So we're looping, true, this block of gold. So we're in the college and start cover teams from pipe. We're gonna call it here, and then we're gonna look between by always spawning new pipes. Now go back to the engine. And first we're gonna add our pipe, which is found in brief perhaps So go to spawn er at pipes that this is the game object. That herding spawn timer will be minimum one second and maximum. I'm going to see you and for the wide bound minimum and maximum react at our pipe and that the check it by ourselves so our maximum will bay some around here. So 0.66 will be maximum because it is the father size of would spawn, er, next, 1.66 As for minimum, we're gonna go down about here. We're just negative 1.5 So that would be the minimum off our by bombs. Now I am going to leave the pipe that everything I think set up. Now we just have tested. When I press play, we should see that our pipes are spawning. So, yeah, is it you are creating of pipes right now? Even though I'm hitting them, I will not die because course we did not create the death. But the thing is that this is working now. The only problem that we have with this is that our pipes all continues this pointing. It's pointing and spawning and spawning and spawning and so on. So they are not stopping with this Pont. And how to fix that will book fix is to add a collector that you will do later on. For now, we're just focusing on one thing that is, that our pipe is points is a six year. Right now we are spoiling. We're waiting for the random range time who want to that being created when we are when that passes, we're gonna extension or pipe the panic on the random. A random range from white bound minimum and by bond, maximum and that forced bringing loop are the omelet were not armed but we're gonna loop are cooperating to buy spawning another pipe in another pipe and another pipe and the pipe and self on. So the thing is that this partner is working So guys, that will be it This with you are Spiner is working out for us and I will see you guys in the mixed with you 9. 9: What's up, guys? A my year. And today I'm back with another video. As you know, in the previous lessons we have added our movement where our bird we have important spawn are ground athletic. But one thing that bothers me is that the Flappy bird game does not start at any moment. I mean, it does not start always not always, but it does not start until we've press space or until we breast a click on our mouths. But our game is starting immediately. So in this video, we're gonna look that through and we're gonna add the death for our player. So big further do we're gonna go to set the birds and open up our birds script. Now, inside our script, we will have to add the new brambles which will be our public bully and has gave started. That will be one has big game store. Is the game started and then we'll have Has bird died. So like this, this will be to bowling's. So right now we're me go to unity because their public trouble save them inside of our inspector. That and a quick way to fix that so they're not visible Where is gonna add these? Ah, straight bars off brackets. And I would call it and then typing hide, Inspector. So right now, even though the public, when you go back to unity, we will not see them anymore. As you can see, community loaded up. So I'm treading policy. We will not see them no more. So these two will control the pace off our game. When we start our game, when we finish our game and so on. Now inside off the update function. We have to check if oh are has the games as the cast of the games target. And if bird birth has burned, Dodds is not true. Meaning so. When you put the exclamation mark after me, I am before the have any bullion or any statement, then automatically, it will be the right opposite. So if this is true, is gonna make it false. If this is false, it's gonna make it true. So in this case, if our bird has not died meaning that this is false, if our breath is not the right we are going to say are the junk woman's wasn't cut. This is best over. We're gonna have our jump move and I'm going to copy this carpet this and put it here. Now cut this and put it here so everything would do for the champ moment. It will be done for the birds rotation and ex movement yet moving on now In what? In what? 10 are fixed Update. We're going to say else meaning that this we had not started our game in our bird has not died. Were going to say if my body got the loss, Did don't Boy is less than minus one and the Berg has not done as Bernadotte is not true. Then we're gonna save my body dot The lost city equals two rector to dot Off which multiplied by jump force and are minimal to multiply. Dad Broad like 3 65 So this is a random number that I have tested out that work. So what is this going to do? Well, basically, before we start our game, I mean in October game we have that animation that it's flipping is going up and down, So we're gonna create that bomb so it could go up and down until we start flapping. So let's go back here on course, and then we're gonna check if we have input dot Get key down. That's what the R key code Geico dot space or our input Get mouse button down. It will be a left mouse. And that you were gonna say, Has the game started equals true. So that people true. And if our birds for bird has not died, we're gonna make it jump. So we're gonna just say jump movement like this because we need Teoh typing here. My or not. Actually, I'm not type junk moving, but I'm gonna see my body that lost equal Steve up multiplied by jump force because it'll back out if we do not do that because you start the game. But bird will not flat, but right now, it will start on game and burger type immediately with it. So now we have to go back to you today and before we test out, we're gonna go back Scripts, game bliss groups in the scripts and we have to change the script that be recently used. This is our sponsor script. Open it up. And here we're gonna add our private bullion starts morning like this and above everything we're gonna add our privates. Private bird squibs No birds. Good. But they have birth. Could be it. Never mind starting private birth And then I'm going to call this barks so I don't burn. So Bert, Bert and inside off away functions awake As I said, a bill to use it I think I send it so birds equals two gave object that fine object of type and were subject for the birds script which are bird has it so evil. Until Matthew said for the birds script, once we have found our birds quipped, we're going to say update Yeah, birds dot has for died we burned Hesburgh die. It is true and we have not starts pawning We're going to say Start courting Ailes upon our pipe like this and I will say it starts Pawning equals to truth. Oh, my bad Not Hesburgh died but has games talked it. So this kind of dumb of me So has has the game started? If the game has started, then there the most point our pipe And why are we using this stuff spawning? Because if we did not use that, we're gonna be and the slope of people's pawn. Too many too many pomp. I've because we will start. Our court is 60 times in a second hand. Just imagine that just imagined else, not ours. But I'm going to say if are birds dot has burn dives. Even true, then we're going to stop all cordis like this. So let's go back our bird script. I forgot to add Over here on the bottom boy on finger Enter Duty and radio ad co Leider cool either to devote plane target This So what's the problem? There is no problem. Everyone to say if Target Doctor had equals two hi or equals two forget dot eagles to ground. We are going to say Has Bernard equals true meaning that we will immediately stop our game in our movement. But everything so far has burned. DOT equals the true. So let's go back and I would far start our gave it will see our it's called player bird to go up and Down Utd's go up and down one for sets for with that junk what I would do it. It will start spawning our pipes. It is working and as soon as we hit one of the pipes, we should die. But it's not happening. That's he wasa problem. So our collider, we have it provider collider. Ok, ok, my bad. It's because we have used on the trigger and their candy. And now if I were to go back of the script, go to assets pre perhaps pipe and put the pipe green up, pipe down and piped up, take the boat and put it to be a trigger. But we're gonna leave are grown to be not figure So delete this And when we have our trigger, we need to use wood on trigger enters right now. If I go and hit the pipe, we are going to die. So I'm going to show you a quick example. So let's go. Rays are part When I hate it, we should die. Yeah, and we cannot move any more impressive space that we cannot move now. Another thing is that right now how we gonna have our ground to be a trigger but still use it as a that because if I want to put the ground to be a trigger So for Laura, I mean to be a trigger will just go past but so right now, you'll see we're going to go past by it. And one thing I forgot to add is to put the is he? I just passed by and that isn't what they're looking for. So right now, to think that will go to script again, then go and typing void on collision and their candy. So this is what are we looking for, premier? When we want, So they may target Stargates. This is what we are looking for when you want to collide where game objects without the trigger. Then with test If our target dot game our vic that tech eagles to ground that is true. We're going to say, has bird died equals troop. Now go to floor moment and I've seen the same is retyped in our spawn er something with copied birth. Our highlight bird birds Copy this former want pasted down Go back spawn er boy awake. Copy that. Bases all over again once that is, I'm we're gonna check. So we're just gonna check this year. So because this is the movement. Think this is where we move transformed our translate. This is where we are checking should be mogul back to the previous state. So if our has birds died meaning that are bird has birth. My bad If our birth dot Hesburgh died is not true. Meaning that we have not died. Then you're going to move it. But as soon as we hit word now Ground or Piper going to die and immediately going to stop our floor movement right now is T It's moving on. When I hit it, it stops with our player with everything I mean so yeah, that is how we add that now. One problem which is the last one is the beacon group I above the ceiling. As you see, we can go above now. Ah, way to fix that is either to create an empty gave object. Call it ceiling then, as our box collider books books leading to the put it above And then you know the drill. That's one way, another way, and I I will use that one. So I'm going to use it with that. And another one is to check if our bird goes like here, then it will die. But that thing cost to not to miscalculating. So I'm gonna move the ceiling up to here right above our camera. Added collider to be like this, a bit more off the edges and assume that Emmy as soon as he hits the top corner. Little duck. But for that, I'm gonna add the ground back. I mean, I could go. I could go on and create taught type called ceiling, and so long, but it's unnecessary. Sometimes you need the same ground as I used for. I'm just mama bet hunger near the same tag as I used for the ground because there is no difference when I put ground. Ceiling could be called ceiling. So right now, when I start the game and go off and I hit it with I immediately So you guys, that will be it for this video. I'm are here and I will see you guys in the next one. 10. 10 Ui 4: Hi guys. Um I hear and I'm back with another We dio as no, we have, like, fully playable game off our flappy bird. Everything is working out, but we're my sink missing that one thing. And what is that? Well, that is the beauty of the game just getting, But it is kind of helping it to be more more visual appearing. And that is are you are said they were gonna add you I inside off our at birth. So go ahead and create. You are text which immediately we quit, Candace, that we're going to call you I that we will have our text which will actually be our score . Texan, this types for text and we have our Evan system that will help out our campus within certain functions, like clicking on the button. It's a warm because the gig on the button and working and making the but work will not be would not be, uh, Haman say, would not be would be possible without Evan system. So, as I was saying, our score text first thing to do is to put it above, So put the top. So it is. It is anchors to be top centered once that is that I'm gonna go to see a good scene and change the size off our score text like this now, because our fourth size of text will be 52. And here we will have numbers like, let's say 100 for now. And I'm gonna put it to be at Mill Middle's. So it looks appearing. Of course, where the fun size believes the funded I will. I laid down the assets of here, so zero for be underscored. 19 underscore. Underscore Off course. We're gonna change color toe white. But there is one thing that will add, and that is our shadow. So go ahead and add shadow. As for X, I'm going to say four and why will be zero now, make sure you put the aid to be at 2 55 So the shadow is more appearing than carpet. This got the component and paste it again as new, supposed again is new and then put here Negative tweet reaction. Negative four Now do the same thing. But for a while. So these new zero on decks for under why or actually maybe even three. Let's do you now for the wife and then Okay, past component is you. And put your zero in a before. So right now we have this, like outline for our thanks. So, no, I put five a book like this one. Do three for every life has its outline. Which black? Current? The black. So right now typing want it to be. And that will be our score text. Next on will be our get ready. So we're gonna add our image. Your image, Which for me Get ready. I'm gonna call it that. This go to source image and look up. Forget read it like this. Whether that will be perfect. Five and height will be 91. This and where I'm gonna put it while at best, able building in the centre. But I'm going a bit above because under that will be armed taps acting. So let's 81 51 50 not wife 1055. But 1 50 inside are Get ready. We're gonna add another average, which are tab Have then, of course, go back here and typing intro tutorial. So this is next up with before this will be do 50 and height will be 1 95 and we're gonna put this directly below it. I guess I'm gonna move it to be, like, centered as much as possible, but yes, some around here because our bird will end up right. What happened? Little handoff right here. Somewhere around here. This is where our verbal be. And this is where we have our intruder tutorial. Then next up will be our scoreboard, which will create So you are image, and then are score board. As for our scoreboard common typing scoreboard which actually this one here, which will be at negative AIDS with high, will be 3 70 and I will be 19 killing this three Saturday in one line. Inside our score with them have are you text, which which is gonna be our score board next. And that is like 100. How much we scored at that time. So middles middle like this. But the anger is to be the right. But for the actual being negative 69. And why will be 25 now for the fun size Pregnancy 28 and I will have to go back here, is it? And just scale it up. So it can fit, of course, changed to be white. And you can add on so called course we're gonna change the font And you can add on these shadows if you would like actually no what I am and add forced for that I'm gonna carpet this tax, Put it inside, change the name and I'm just gonna copy the wreck. So, Rex fast from the coppers component and basic over based component valleys Right now if I believe this one, where is this point here? So why it's not visible. Okay, let me So I have to be to be a bit bigger, but fun size will be changed to 28 force. So, as I was saying, 60 negative 69 for the X. And why will be 25? Uh, guys, this will not work. So I'm going to remove show, so I want to test it out with the shadows, but shadows of mouth not look appealing on this one is like too much. So I'm gonna leave it like this. So this is going to be on scoreboard text, then duplicate that and we have our high scores for test so hard scored I capital aged high scoreboard text like this and we're going to We're going to leave it there, but just gonna change the why. Which is negative. 45. So let's say our best hand our sport are equal. Then we have to add our methods. What will be our sport World without medals to go with you, I create an image. Call this silver medal. I'm gonna cheated Silver Medal like this, What will be a $69? 5 55 to $69 5 Now, are you gonna change the what's called Transform to be right here. Where are males? Should be so I could do that on your own. You do not need to copy days, but you can. And I'm gonna duplicate that and call this gold medal and just change the source image to gold. And both of them will be off trigger because we need to check home. How much did we score? You make this look so to have it be there. And now last but not pleased. We will have our buttons. So you I button this will be our play. I only did text and go on and put here are sprites rises, right? I just think it sorry about that. So Okay on, then I'm gonna put it to be at the top left, anchors up left, anchor off the scoreboard. 78 for the X and Y will be negative. 1 to 9 with in high will be 1 80 by 60 like this. And we're going to duplicate that and put anchors to be at the right and just put it down to be the same with the same wise negative 12 nights and change the sprite from Okay, just pride. So 004 which are sprites menu, Not zero. But that was underscored and call days menu. And I thought it was the last. But our last will be our image off. Game over is called It's Game Over and our spy for game or it'll be game on the score over what will be 308 height will be 66.5. I'm gonna believe it to be a top and a bit above anchors will be at the top And somewhere around here, where our game it's were on get readies. So yeah, that is how we're gonna set up. Are you I in the in the upcoming videos, We're gonna screw them. So I know you're eager to learn, and I'm gonna end will quickly. So that's what it for. Are you Are you all? You can check it one more time. But our team he Arlen did it. You can even do it without my help. That that will up. That is what I think of you guys. I think you can already do that. As I was saying, that will be it. And until next time I'm Amar and goodbye. 11. 11: Welcome back, guys. Um are here and today we are moving all with our flappy bird. And in this video, we are gonna create our main menu. So to do that, I'm with a press control plus and your cue board, or you will go to file new project My bad Nothing project file using when you see it like it's the first thing that you project new scene that I will pass control. Plus, as when your keyboard or you compress we could go to file and then safe scenes. Then you will go to saints and type in the year made Manu. Now, as for our main than you, argument put our size for camera to be saved as in our game play, which is two point do coffee that basic over. Then we're going to go to assets sprites at our background they liked. Then add are floor, so go back to saints game plate and actually I am gonna These are actually am Ghanem is our breakup prefab our floor. So I did not create that out over again that the time consuming I mean you can, but it is just to preview of it so go back to scenes. I mean, then you and put our for lower down, then for are you eyes? You are here. You I will have button. And this will be the only button. And this this whole of you high. He even if I can call it like that and I'm gonna talk to your play, search up for the lay buttons of this play bt n, and I'm gonna put it in middles of middle middle. What will be do you do with a like this and hide? I'm gonna put 1 71 17 So it's gonna be big button right in the middle, Bit down like this. Okay, Never mind. Let's like it zero. And now, last but not please, We're gonna have our flat few bird, so quit an empty game object. Reset it at component image. Both my bad not image, but sprite render. And we even look up for the that the birds. So this is going to be the lefty birds and I'm gonna bid above, So let's see 1.3 and I'm gonna call they just titles, title Bible and inside our title, I'm gonna add our player so go ahead and top people at our let's go back sprites and add our blue birds. But actually we're going to go back to scenes gave Lee save our scene and I'm gonna prefect are birds single backsies pre fabs because we are going to use our flappy bird. So why not use it like this? Go back to asset seeds and men save it. But right now is our revamps for the flappy birth. But it inside a title raise our title at what's going on so orderly one of this. As for this left birth, it's only gonna have any meters. So surgical either. I'm gonna put it down. Which body, Cinematic. And I'm gonna turn off the Flappy bird script or even I'm going to remove it. Actually, I've been removed to go ahead and move component. You move component and component. Only thing that we have is our what's called an e meter, and we're gonna move the whole title like this. It's kind of in the middle. And now when our start our game, we shall see, we should say that our birth is flapping so you know, errors, nothing. So we have one Arab which is our floor and our floor. We are going to remove the Lord moment unnecessary. It's causing this ours. It's causing us errors. Let me start is once again see, there are no errors yet. They are not. Now, as for our main menu, we are gonna put our animation on our title. So go ahead, quick on the title. Go into animation and create animation and go to animations. Create separate folder. Call these me Manu Annually. And here I'm going to see title. So title flat like this because it's gonna go go up and down. Now how we're gonna do that? I'm going to copy the current positions of carpet, Click on the title and click on Days Rad Circle, which means the record going to report Go to 30 frames, goes to firm easterly. Put it a bit above so summer around here to 1.4 day and then go back to one between 60 seconds and then face down the value that was before. And I click once again on the report to disabled recording moat. And now when I click on information, this is what is going to look like. So let me out when I start off game and you will see our flat people title is going up and down, creating the scene that we are looking for. Then we're gonna add an empty game object which is going to be are made menu control group for alert, which is going to have only one one a function. So game play scripts, see a sharp script or not again, please. I'm going to create separate folder May manual script like this and then add C charge. Could do some skiing. Made many controller like this. And inside the bar main menu controller we're gonna add are mean menu controller. Come on, you get up added inside of Army, many controller and open it up. And before we type in that one line of code we have typing using unity engines is in unit engine that seem manage ment like this. Then the lead. All of this all that block of coat and typing public void Blade gave Oprah parenthesis curly brackets and we'll say saving manager that load scene and you're loading are gay game Lacey like this now to sexually make this script work, we have to go back to unity. Go to file. Come on. File on top. Left file. Okay, build settings or press control shift. Be refer, cut and then at open scenes. Now, immediately, we have added a game placing, but it's going to switch them up because we've seen is at number zero will be start when the game starts. And we did not want to start with with arguably. See, we want to start with Army. Many So just dragged the main milieu toe on top of the game play and save it. Now go on to canvas play and add on click options at it dragged me many controller todo game object and search for the function which is our game. What's all that is done? We can start off game and once I click on the play button So what's likely going to play? But that we will go? Did they gameplay scene? So, guys, that is what I wanted to show you this video. So this is how we can switch around the scenes and yet that will be it. And I will see you guys in the next week 12. 12: Welcome back, guys. I'm on here in today. We are moving our with our game placing because the previous one we have looked up for Army menu scene and created the U I for it. Now we are We're going to change the eyes for the game play. Say, to do that, we have to create an empty game object that you call game plate controller like this in the reset, its transform go to scripts, gameplay, scripts and create CF South crib. I'm in a called game late control of Landis. You know the drill. Once we have our deeply controller, we're gonna add it. Our gameplay controller came object, So just drag on in the expected tab and of course, opened it up. Now, inside of our gameplay controller, I'm not gonna fully holy, could it? So, with this with you, where he's going to do not like update. But you will see first we're gonna add are private birth script, then will be called birds. And we will have our public game object which will be our get ready, get ready and are score board count like this. So in our away function, so awake function. We're gonna stay birds eagles to game object Got fined object off type and they're searching for the birds script. And only one who has the bird script is actually are is our birth that we're going to say, get ready or not being used that that will be actually updates to go back to inundate Click on the game Play controller. Where did you wait till it blows up? And now add scoreboard panels and add to get ready angled back to script an inside of update function. We're gonna check if birth that has gained started is true. Then our get ready. That sets actual be false, Meaning that when we start moving with our birds when we want you. So when you press space, this get ready, ready function will be automatically off. So it will go off right now. It's because when you press space, it will be off That moving on We argument, check If our birth died, has died or birth has died. We are going to say scoreboard panel God's set activate to be true. But this being that when our bird dies, we're gonna open up our scoreboards. Pretty simple now, last but not place what we're gonna do. For now, he's typing here, using units using unity engine that scene management because we have. If you remember, we have. Here are two buttons which are play and menu. So we're gonna use one of those. Do so have a year public void, play again. Again, a game like this. And here we're gonna stay senior manager dot load scene, and we're gonna search for the senior manager that get active scene that build index. So we're loading the scene that is currently on. I mean, of course, we can put here like steam manager dot boat scene and load on a gameplay we had that. This will work. I would still, but let's say you're building another game, and I would like to use this as a practice because in other games you may have, like, mawr scenes, and getting by name is one. So that's one option is also workout works out and another option is to get seen that is currently active, so you can choose between these two. I personally like more the first option, so I'm gonna leave it there. Then we have our public void Go to menu. And when this comes on that I'm gonna use the second option. Which chips? Which is seen Managers got glued seam and you're searching for the men seem like this. So as we did inside of arming manuscript, we're gonna do the same thing in our gameplay. So click on the play button, click and click on the menu. Go down at one click option and track in gameplay Controller. Now, as for our play, we're gonna have our gameplay control up again. Then menu function gameplay controller. Go to Manu. Now all there is to it, it's just things out. So let's start our game and right now is a good TV. We are not We're not moving, but this things you press space, get ready, disappears We are heading our streets with works and when we die, our game over tap shows up. And one thing I want to do is to stop the animation on the player. So right now we're gonna test Menu is working and I'm a test one more time is if Okay is working out, okay, it is working out. So let's go back to script. Find the birds. And here we're gonna search Where is it? In our update function We're going to check If has Bird died equals two True. We're gonna say so Go back here We have We need to put you private Any mater and him So I did not know about you but it bothers me and me it like it hurts There's my eyes animator Get component Animator And here we're gonna say And God speed equal to zero That's one way which is the easiest one I know Other one is to create the transitions in so on I'm not going to bother you with that right now, so OK, let's just out one more time when we die we are animations top So play Come on Anti Compile it When I press play you'll see that when we die are our animation stops So right now I do not like this. Okay in menu they're kind of to below two off. I was going to change that to lay in the news. Good scene. All right. What is it gonna put it a bit more up. So somewhere around here this life looks a bit nicer, but ah, big up, right? You planned it so you can copy the position Accent by if you would like to. But basically, that is what is so guys, that will be it for this video. I will see you in the next one. Just like on the continuing stop right corner bottom right. Quarter my bets. Goodbye. And I will see you guys in the next video. 13. 13: Welcome back, guys. Um are here, and I'm pretty excited about this one. This one I mean, this video, we're gonna add our score to the game, so I know you're eager, eager to learn, So let's do it right away. The first thing we'll go to scripts, sappy birds and open up our bird script. Once you're inside our bird script, we will add another integer with who? We will be our private into your score. And then we'll go down, down, down until we hit void on through their enter d where we went to check if our target that tag equals two pi score. If that is true, we are going to say score plus plus And we will save that in our player practice player preferences that set into jerk something. Our score with our score value, which is inside our birth. If you do not remember, let's go defect assets brief abs And he did not remember our pipe. It's actually tagged with the pipe score, so I'm added and would ever be cross this line over here. This box collider with our bird, we are gonna get score our sport. I mean, so just engage. If you do not remember, I just said it, so I hope you did. So whenever we get past with, we're gonna set our player preferences to our score. And why are we using player preferences? Will, Basically, right now, I want to use a gameplay controller and use the same score. And to do so, I believe the prayer preferences because all the things that I need for the play of preferences is to get the idea. So let's go back to complete controller here. I'm gonna create avoid sport off date on this, and they're on Missy's war. Okay, I did not add that. So go back to above hand hungry. Let's see here private images score seemed as I need for the bird and I'm going to see score equals two player preferences dot get integer and we're getting our score and then put a comma zero, which means the default value is zero. Now, we're gonna say here using unity engine thought you eyes so we can access the u I. And actually we are getting access. Are so public. Thanks. Which will be our sport text than are score board text in our hives or board text like this and inside our public game objects, we're gonna put in Silver Medal and Gold Medal and then we can move on with our score update inside the sport Updated. He said that our score equals two. Score into the Murray player practices, get into the score and here we're going to say score text dot text equals to score. That was drink. So like this now for our sport board were text the text equals two, same as we did go here scored two strings like this and last but not please Our high scoreboard text dot text equals two layer preferences that get integer and we're getting high scores Price war dot you street Now the default for our high school will be zero and right now we're going to create an object of the function. But we're going to create are void set new heart score and how we're going to do that. Well, basically, we're checking if our score is greater than layer preferences thought get integer, and we're getting our high sport spore like this. If that is true, we're going to see Les of Preferences that set integer and we're going to set our high score to be equal to our score like this. But it is simple. Now, once again, we are using player purposes for our high score. And that's basically because our player preferences, as the information here says stores and access the sorts of excess player purposes between game sessions. So right now, if I were to play this game foursome for some time and tonight, quit it. So I press played and I quit it and come backed it. A blade of grass visible store are store our high scores, meaning that it will be always there with us. Now inside update, we're gonna get down here. We're gonna set, score, update, update our sports. Or for for that, we have to call out our function. And we're gonna cup out are set new high school like this. Score update has said, Okay, you know what? I'm gonna cut this and put it inside of our sport. So basically, we're calling our set new high score inside of scores of eight and score off the is called an update function now. Last but not least, will be are void set the metal said the medal were we will test. So he were going to say if our score is greater or equals 25 and our score is less than 10 if that is true, we're going to say silver sil Silver silver medal. Thought said good to be true. So above here, I probably spelled it so Silver medal, a silver medal in this and correct. Yep, I'm correct. If that is true, we're gonna set our gold medal to be true. Else if we're gonna check are scored is greater or equal to 10. We're gonna set our gold medal. That said, I think to be true. And if nothing, if our sport is less than five pregnancy else, So else we're going to say Els, come on. What is going on? Civil war, mel dot Said acted to be false on our gold medal God sent active to be falls and we're gonna call this our update functions set the metal. So right now everything is set up. Only thing we have to do is to attach the Augean objects and our text inside of our gameplay patroller as our score text, add score decks. As for our scoreboard tax for vortex high school vortex. And then silver Mel, then gold medal with now the best control Plus as to say that gameplay scene and everything is ready to be tested out. So right now, when I took play, we should see here. Zero am I correct? Yep. And when I pressed space, we are moving right now. When I get between these two, I get one score to score three for I'm going to try to get the gold. 1567 and close a nine and 10. So right now, I will get this cold metal. As you can see here, I got gold medals and our best is ultimate. We save when I press okay and then start once again, we are starting with scored 11 which is bad. I mean, way restarted, score zero. But here it says, it's you now await the things that is actually here. We set our spare practices dot Get into score zero. Now, as I said to fix that, go inside of the wave function and say here, Blair references the set into your arguments set our score to be zero. So every time we have start up our gameplay control a script. We are going to put our score to be zero. So let's does that out one more time, mostly. Come on. As you see, we start out with zero. My bad had no one to die that quickly. So let me get at least once for And if you think this is pretty easy, you know, pretties bit. You can always as you see it works. You can always go back to pipe, put into our pipe, go there. And but let's say our pipe down to be a bit more now like this, and our pipe up to be a more a bit more up like this. Then he applied to save it. Go back to our visit our Sponder and Force One and we have it. Our pipes. I'm gonna add it one more time. And now it will be a bit harder because there is smaller space to go in between. So this is what you will do If you're not sets. Why would I think it's pretty? Is it? And hot now? I think unviable. So like dining has to be Birthday is antique. Yeah, Right now it's pretty hard. So I'm going to change the pipe as before, but undoing things did and apply and as abates. So, guys, as I said, that will be it for this window here we have implemented our score. I are high score. As you saw here, it was pretty simple and pretty easy to use. Now for the scores up here, it's up to you. You can change light for the civil to be 10 between 10 and 20 and gold medal be after 20. So you can check that however you like. So that part is up to you and up to your testing is all said ours. Or as I was saying, this will, that will be it for this video and I will see you guys in the next one. 14. 14: Welcome back, guys. I'm are here. And today we are going to implement some sound FX in our game. So what are we waiting for? Let's get started. And of course, the sounds that we're gonna import are found in the sounds Followers To keep that in mind and to implement them at all will go to Flappy Birds. Fun. It's script and open up our bird script. Now, once we are inside our bird script, it's gonna breathe pretty simple. From here, only thing you have typing is our public deals are ideal. Clip all the clip and then we'll have our that clip. Our ally collaborates actually are jumped and our score flipped on. Nothing but collect like this. So let's go back to unity. Check out our that the birds. I was it sounds seen Tow sets. Come on, Assets woke up sound. And is it to you now for our death? Who added that clip for our fly will add fly flip and for our scored will add the score clip Hey, don't fly so we can apply that to our prefab. And of course, right now we'll have to go back to our script. Do you instead, she ate it. And how we're going to do that? Well, basically, we're gonna search. Where is our junk movement? Which is right here and below are jump. We have to type in here. Ideal source. So not sore, but I'll deal. Source. That filet clip at went and where planes are, What sleep for are jump we're gonna play for Why click by click at one position at are trends from God. Position like this They will go on the next one which will be our score way We're gonna say type in the same thing So I'll dio How would you? Sores don't adds not add with Blake Calypso Blais clip at point an airplane are spore clip at four chance from about position in this and that our last but not least will be when we die, which is when we touch the pipe. So here I'm gonna type in what's called Aldi. A source dot blake like point are that clip and we will have our transmit our position. So right now, our competence and basic over to the ground It's basically the same thing. That and everything is hot set up to be tested right now. We should see one problem. I mean, we will be our problem with our debt. So right now you see, when I jump you, you should be able tow here jumping. You get here. When we scored here, we hit. As you see, that was a problem with our that So I'm gonna right now Put the cat and a microphone the bed. So I'm not gonna talk. So listen up, as you may here we have, like, died. I mean, we have implemented the sound like 3 to 4 times after our death. So that is something that we need to fix that go back to our scripts, and then we're gonna pigs up. How? Well, basically, when the check, if art has burned, died and then at exclamation mark before So exclamation mark has our diet, meaning that if I if our birth has not died, we're gonna play that clip. If our birth has died, then you're not gonna play that clip. So it was a pretty is. It affects that you will thinks right now. So I have a pompous sound up which is up so one more time before I leave So I can just show you that it is fixed. Kwan with what our game played. Did you get here and then we did not hear like when he died. Oh, yeah, My bad. Oh, if our Britain's now well, so that has to be above it. So above the has bird died because we're gonna check first if it's not true, because if it is, then we're not gonna change it. So, like this right now, we're gonna check it out. So this is the a well placed code that needs to be because we first call out our Hesburgh to be true, then checked. If it's not so you could see right now it is working. So what was the problem? Right? There were basically we put our Hesburgh die to be true. Then check if it's not true. Hand off course. It will be true because we have put it that way. But like this, we checked first. If it's not true, it's our verbal dot And then we'll put our bird to be debt, meaning that we will not repeat the sands. So you're still in the state for me? How? Probably you were thinking like what Is this effective doing? So, guys, That will be it for this video. I'm are here and I will see you guys in the next one. 15. 15: What's Ah, What's what's up, guys? I'm are here and I'm back with another video. And in this one, we're going to fill up some blanks that we did not before. So, first of all, we're gonna add the pipe collector. So right now is get Eve. We're creating the pipes, and none of the pipes will go down after some time, which should be happening, because that's right. Now we have, like, 12345 pipes, which is okay, nothing to be done. But is it here? Right now, we have passed these 123 three pipes which are not needed. So, like this are just kept costing us a performance to our game. And a ZAY said they're not needed. And if they stack up, they could hit our performance. They could they could slow up. So applause, so down our game were just pretty bad for it. So we're gonna think that to do so we will go to scene. Um, I bet the hero keep the main camera, and here at a nem P gave object. So for anti game object, I'm gonna call it pipe collector. Oh, cool. Like door like this for our pipe collective. We're gonna add a box collided to its import duty, which is gonna be, like 0.2 on the X, But on the why it will be big. So So So it does not miss anything so like this. So we catch every pipe that we need and for the position of the piper gonna leave it. Uh, we're gonna let it somewhere around here because I do not want my part to disappear at the middle of the game, so I'm gonna put it a bit out of it. So every time we catch on any off, the pipes around here are pipe will disappear. So put it to be a trigger on right now is you know, our pipe has not rigid body at our pipe. Collector does not have its dude, but they're both the trigger. And to activate a trigger, we actually have to add our rigid body duty, of course, and just put the body type to be die cinematic. My bed now dynamic but cinematic so and will be at sitting at one place because if I put it to begin at the dynamic, you know, it will just fall down and it will be none of the work that's needed. Let's go back Assets to script and inside the barn gameplay scripts we're gonna add R C sharp scripted it. It's gonna be called pipe collectives. Five Coal. What? Like this? And now you know what to do. Drag on our pipe Collectors by collective are by political in here are key. So just hold on it dragged on and put it right on our pipe collector. So right now we're gonna open it up in visual studio or more developed, depending on what you have. As for our pipe collector, we're gonna believe everything. Because it's only gonna have one function, which is our void on trigger and hers and her d We shall type in collider to de between a target torre get and then these brackets. Now, if target dot tag equals two, uh, pipes poor, we're going to lead, even destroy our target game object. So let me check one more time. It's the pipes score. Yep, it's pipe score. So every time we touch one of the pipe scores with our pipe collector, we are going to destroy that game. Objects were gonna remove it, remove it from the game because it's unnecessary to have it. I mean, yeah, way are still gonna have some of them out here, but, like, fee of them are not gonna cost us any performance. So right now, I'm gonna try to be a bit far score. So as you can see right now, we have, like, three pipes on Lee. And even though I have four score, so I'm going to continue, and it will always from a at the three and three will not do like any any riel damage to our game. I mean, you can put our pipe a bit more to the right, as you can see. But as I said, it's right. Not really needed because three of the pipes will not do like that much damage to our game . Too slow with them. So, yeah, that is what our pipe collector is going to do. And the last thing I'm gonna add is our flappy birds. So we're gonna change up our script a bit by speeding it up every few every few time we get the score. So right now I'm going to create a separate void. What's called way. Speed up this. Speak up. And he We're gonna check if our score equals two. Let's say five we can put our score were is it not score, but speed. Speed up. Oh, we have it. No, but expiate currently is at one we can say equals to 1.2 or 1.1. Then else if or if we hit the score like not do you Not too bad. Last we had, we'd score How much like 10. 15 Let each and every one every fifth score. We're gonna speed up our games. So pregnancy if our score is five else if our score is 10 remiss, say our speed ups three else If else been copied, its 15 we're gonna put won't going five like this five and so on. And you will call this in update function. So every time we pass our score to speed up every time past our score, we're gonna how we're gonna change that. It's big. Change it speak. And why am I doing it like this? Well, basically, because like this, we have the full control it so full control score. And here we can even add to change the what is called the jump so we can change our job, making it jump even bigger. False moral, depending on what you want. Another way to do it is to create a numerator. So I did it in one of the game, so I numerator like, speed up do. And then we're gonna yield during wait for seconds. Unless they wait. Every likes heaven. Seconds. We're going to speak up our game. I forgot to add new with seconds. And every seven seconds we will have our speed expiate lost equals 2.1 off like this. And then you can start. Cortines beat up too, so you can look the two and every every seven seconds. We're going to speak off our game. But I personally like it more. Or like it better. When are when we are touching with our score? And you can even create out like an algorithm that will check it for you. So right now, Harper display. You will see that are flappy Bird speed is one. And when I hit when I reached for five, let me try the region Born He almost died a gay I ridged way. I weighed five we are. Our access beats up, meaning that we speak up a bit of our game. And the more we go on the father, it will be for the player to keep up and not to die. Which makes our game live bill a little bit more challenging and adds that excitement or is not get boarding because it's too repetitive, same speed. They're just going past the pipes. So you guys, that will be it for our flappy bird. And I will see you guys in the next video, so goodbye.