Create a Basic Game: Game Development Tutorial
A free video tutorial from Next Edge Coding
Full Stack Developer & Data Enthusiast
4.3 instructor rating • 3 courses • 17,813 students
07:07:15 of on-demand video • Updated April 2018
- Gain an in-depth understanding of HTML canvas
- Learn to build games with external resources
English [Auto] Hey you're welcome back. So in the previous video we have added the game over condition. And now we pretty much have a functional game right. We're still in this game is lagging something it's lacking an initial screen. The user can restart the game and all that. So what we're going to do is in this video we will add all those single features and at the end of this video we will have a basic game ready. So the first thing we need to have a start screen. So at first let's do something like this. So it takes to read at how quickly it was done the game as we have done in the snake game. That said and again we want to start again whenever there is a mouse league on and and we don't want to just start the game right over when we fix the page and all that. So all I want is you know let's just find on most don't function anymore the user because the mouse didn't start again. OK so on most functions. Now here we can simply hear bender or Again there's no part of this game function. So if you start game from here now if I on this great it should show me a message at first. Yeah. So if I start the game and I can play trade but there's no problem with this. So the fight just faces change and if I continue clicking say I do something like this see you I can't even see the ball on the base anything like that. So it's just too -- fast. So why is that so fast. In the first place. And also this lives. I don't know why but it's not working. So we will look into that. But this is a very fast rate so to stop it. I have already shown you why this is so passe. It also occurred in the games case and that's because if the game is already running and we click again then the state in manager is a game called you know also though it's not clear the previous interval is not clear and it's a call. So there are like enduros running in balance. And the more danger the number of seconder was increase and that's why the game is kind of too fast and you just can't understand what the hell is going on. So what that we need to declare here one more table and this variable initial It will be false. And that would be true. When we start the game and you're right or we're here we need to check whether the game is already running. So if it's running then well first of all since we're running through bonds and the play into the box interval that this can pretty much work and there is also one more thing with the game function that we missed. You know we're only in our genome just ending the game whenever done lives is less than zero. But there's also one more condition for which the game would be over with the use of actually finishes the game right. So when does or does ecord withhold between 30. Then also we have proven the game right when the user finishes the last time then the game will be over for him and he can again restart and continue reign. So I think this is it. So and also after this let's just add some message that the game is over. So now they're stranded at sea. Whether the game works or we need to change the game or we're going to and well it is working right. So basic game is pretty much really as of now and then I don't look into the platooning and all that it's just because I been recording and playing at the same time there's a reason. So the PC game is really. So we're going to do the next few years that we will you know increase the difficulty of the player right. So right now the game is pretty easy and you can just move the base the ball is also slow. You know the speed of the ball is not also increasing. So we are only going to introduce one condition over here and that is the speed of the ball and will increase the speed of the ball with time. So we'll see how that works. That's it for this video and I'll see you next.