Godot 4 Crash Course #1 - The Basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there in this tutorial we are going to create a space shooter in Gau and while making the game I'm going to explain Gau from scratch so you don't have to have any previous knowledge although before that let's cover some Basics most importantly gdau is a game engine and it is somewhat similar compared to other game engines like unity and real or game maker they all ultimately work in the same way in the sense that they are giving you the tool tools to make games this would include creating Graphics getting input playing sounds covering physics exporting the game things like that if you combine all of these things you hopefully get a game out of it at the end the really nice thing about gudo is that it is completely free community developed and open source which means there's no chance of anybody raising the prices like for Unity for example and since it's free it's also really easy to get started which it's why it's becoming so popular recently let's install it right away the website you want to go to is called gdo engine. org and on there you can see it right away you want to click on download latest to get goo version 4.2 now this version is super recent as a matter of fact it came out while I was making this tutorial so for the videos I am going to work in good 4.1.3 but it really doesn't matter the differences are much more advanced and I'm not going to affect this tutorial whatsoever so simply click on download latest and then you should be getting this page where gdo gives you the right version for your operating system gdo is available for all the major ones so Windows Mac OS and Linux are supported if you go down you can see a few more versions but this shouldn't be relevant all you want to do is click on good engine and then you're getting a download page and once that is done you can close the browser and now in your downloads folder you should have a zip file that you can extract after you're doing that you are getting getting a folder with two files if you double click on that one you get the project manager and in there right now we don't have any projects so gdo is trying to open an estet library but we don't want that so click on cancel now this at the moment is entirely empty but later on once you have a few projects they would show up in here but at the moment we don't have any of that so I want to create a new project and now we are getting a couple of options most importantly we need a name for our game I want to call it space shooter after that we have to create a project folder I am going to do that in my documents folder but if you have your own setup just use that also the files you downloaded for gdau you probably also want to store somewhere outside of your downloads folder but anyway once you have your setup you want to click on create folder and then gdo is giving you a tick and that's a good sign after that we have to choose a renderer and there we can choose between forward Plus mobile and compatibility I would recommend to choose forward plus although for our basic game the differences really do not matter they do start to become important when you get to 3D but that's not what we are going to do so choose whatever and after you have done that go to create and edit then gdo is going to load for a second and after that we can see the gdo editor now I am going to explain all of this in detail in just a bit but be before we get to that I want to make a few changes and that happens under editor and editor settings specifically under theme you can get a custom color I do not like the default bluish color and Breeze dark I personally find significantly better it takes a few seconds to load but after that you get much more neutral gray colors although the choice here is fairly personal if you want to have a light theme that would also be in there on top of that in the editor there is display scale 50% is the default one although in my case I'm going to use a custom scale of 250% or 2.5 in your case this probably isn't necessary but some people are watching this on a smartphone and it's going to be really hard to see if everything is so small but if you have Vision issues this would be a good way to get started so with all of that I want to save and restart and then things should be much more visible even on the small screen all right now with that out of the way we can talk about the core of gdo and that would be notes and scenes notes are the most basic building block that you can have in good do those would be images sounds timers animations text and there's a lot more what you can do here gdau has a few hundred notes and every single one has one specific purpose we are going to work with quite a few over this tutorial the main thing you have to understand is that you have to combine noes to create parts of your game for example our player is going to look something like this this at the end where we start with a parent node this one would cover the physics part so the collisions most importantly after that we have a Sprite 2D and this would simply be an image so the image of the spaceship after that we have a collision polygon 2D and this would be the Collision shape after that we have a timer for the laser we have a laser start position and we have a couple of audio files all of these combined are going to create the player ship we are going to start with that very soon but first of all we also have to cover scenes and those do two things they organize and display nodes for the first part scenes organize nodes by basically being a folder for the node and you can place a scene with nodes into another scene this would look something like this this is going to be the main setup of our game where we for example have the player we have the lasers we we have the meteors we have a couple of boundaries and we have the UI those are the main parts of the game what is really important to understand is that this player is simply the entirety of all of these notes in one scene and then placed into another scene so the way you have to think about it is that all of this level is one scene and then this player is another scene that happens to be inside of the parent scene but inside of the parent scene the player is simply going to be another node that you can very easily work with that way gdo makes it fairly simple to create really complex scenes for example for the player and then insert them into another scene and not really worry about the complexity makes it really easy to organize your game besides that scenes also display visual nodes for example if you have a spread 2D IE and image then this one is going to be displayed via a seene and that's basically it if you understand these Concepts you already have a good start with Gau so let's do some practice here we are back in Gau and at the moment the main thing you see in the middle is a 3D scene also at the top you can see we have 3D selected which isn't what we want we want to have a 2d scene and there you can see we have a 2d scene also you can move around if you hold the middle Mouse button and move the mouse you are moving the entire scene and with the SC wheel you can go in and out and that's basically all you need to move around in a 2d space there isn't that much to it also if you look at the top there we have script and this would contain our scripts later on but for now don't worry too much about it all we need is 2D so this would be an empty scene at the moment there literally isn't anything in it to change that you want to look on the left side there we can create a root node and as a reminder we always place a node into a scene at the moment we can select a 2d scene a 3D scene a user interface or another node if you click on our note then you can see all of the available notes inside of good do and there are quite a few if you extend node 2D and there are a few more things you can extend then you can see all of the available nodes that we could create for example there we would have a path we could have a line we can have some particle we can have lots of different things there's also static body 2D character body 2D basically physics bodies but none of that is too important right now so I'm going to close this dialogue and instead I want to create a 2d scene so if I click on that we have a node 2D this would be a very basic node and if you want to learn more about the node you have selected you want to look on the right there we have the inspector this one gives you all of the attributes of this particular particular node for example for this node 2D we have a transform tab where we have position rotation scale and skew and if you look at this scene there we have this Red Cross dot thingy this is the note 2D it doesn't have a texture so we can't really see what's going on but if I update a position you can see that this cross is moving so we are indeed updating the position although this isn't what I actually want to do so let's then do all of that instead what I want to do is to actually add a Sprite Tod to this node that way we can see something for that you either want to click on this plus symbol or press crl a on the keyboard in either case you're going to get a create new node dialogue and there you can attach any kind of note to the current note you have selected and since there are so many nodes usually what you do is you use the search function in my case I want to get a Sprite 2D if I now press enter we have added another node to the scene and this Sprite Tod is a child of node 2D meaning whenever we are moving or rotating node 2D I.E the parent we are also applying all of that to the child spreite 2D and now if you look on the right in the inspector we have quite a few more things that we could be working with most importantly we now have a texture if you click on that you get quite a few options but most of these you don't really care about what is a much better way to work with this is simply looking on the bottom left there we have the file system at the moment we only have a single file the icon. SVG of Gau this you can simply drag into the texture slot and it's already highlighted if you now drag it in there you can see we have the Gau logo and now if you go to transform you can see we we have the same attributes again and if I now change them we actually can see something going on so that feels significantly better once again though this is not what I actually want to do as a matter of fact let's get rid of the Sprite 2D and now we are back to a simple node 2D since we want to make a game we need to have a couple of art Assets Now in your case you will have to download a folder and you can find the link to that in the description in my case I already did that and what you get is a SPAC shooter assets folder where we have audio and Graphics to import those into Gau you can simply drag and drop them straight in there and then you have the graphics folder with all of the contents the same thing I want to do for audio and make sure that you do this properly so right now by accident I put the audio folder inside of Graphics to change that simply drag and drop the audio folder onto r press then good is going to think for a second and now we have an audio and a graphics folder audio is not too important for now Graphics is much more interesting in there for example we have a couple of ships and you could select one of them doesn't really matter which one you choose but for all of them we have to go back to node 2D then press CR a and select a Sprite 2D once again I want to add one of the players ships I'm going to use players ship one red I think that's a pretty good default choice if I drag this one over we have a basic spaceship also what we can do is to rename the nodes for example this shouldn't be a node 2D let's call this one the player instead you could also rename the Sprite 2D if you double click on it let's rename this one to player image and by the way in good do when you are giving notes a name you are usually using Pascal case I.E there's no space between the words and every word starts with an uppercase letter although all of that is just convention you could name them whatever you want cool with that we have one scene that contains two nodes a node 2D and a Sprite 2D all of this I now want to save and for that you can press controll and S or you could go to scene and then save scene in either case you're going to end up with a save scene as dialogue and I want to create create a new folder that I'm going to call scenes in there I want to have a player. tscn file that is the file ending for a scene so click on Save and now we have a player scene with a couple of notes what we can do next up is click on the plus next to the player this would create a whole new scene and if I zoom in you can see that the blue border around it is the size of the window that's going to become important in just a bit well now though I want to create another 2D scene and this I'm going to rename right away to level also I'm going to save it by pressing control and S and this should be level. TSN G always picks the name of the first node as the name of the scene so level is what we also get in here cool with that we have two scenes for level and a player what I now want to do is to insert the player node into the level and for that besides the plus icon you have a link kind of Icon if you click on that or press control shift and a then you can see the available scenes that we have created at the moment this is player and level and I want to add the player to the level and there you can see we have the player inside of the level and by the way you can move it wherever you want it to be if you look on the left at the scene tree you can see this symbol this is telling you that this Noe is a scene created by the user if you click on it you get back to the scene where we can work with all of this in detail and well that is one of the most basic things you have to understand in good do that you have a scene with notes and then you can put one scene inside of another scene and that scene would become basically just another another node that is much more complex but you can still add other nodes for example with the level selected I can add another Sprite to D and this I could rename to let's call it BG and this PG is going to be the background for that I want to minimize the ship folder and instead look at other there we have the BG this BG I want to drag into the texture of this new Sprite 2D and now we have the background and this we have to rearrange a bit to cover the entirety of the window something like this and well now we have a background although you might have noticed that the player isn't visible anymore and that is because of the order of these nodes basically the further down a note is the later it is drawn meaning at the moment we are drawing the player and then we are drawing the background as a consequence the background is on top of the player and the player is not visible anym to change that all you really have to do is drag the background before the players being drawn and now we can see the player again perfect and that is basically all I wanted to cover for the basics of good do let's do an exercise to make sure you have understood I want you guys to create a meteor scene and place it anywhere inside of the level scene the graphics for the meteor you can find in the graphics folder there are quite a few textures just select one of them doesn't really matter pause the video now and see how far you get all righty back in good do I first of all want to create a new scene and the Paran note for this one is going to be a 2d note or a note 2D which I want to rename right away to VTR after that I am going to click on the plus symbol and add a Sprite 2D this Sprite 2D now has a texture and for this texture I want to go to meteors and there we can select one of them I'm going to go with the first one although it really doesn't matter and if I do that we have a meteor inside of the scene after we have that I want to save the entire scene as meteor TSN click on Save and now we have a meteor scene this I want to place into the level and for that I want to click on the Chain symbol and then add meteor TSN and now you might have noticed that the meteor is a child of the player which is not what I intended and as a consequence of that the meteor is on top of the player now I could simply move the meteor away from that which would be a good start but now look at what happens if I move the player around the meteor moves along with the player and that happens because the meteor is a child of the player whatever changes we make to the player would also be applied to the meteor for example if we go to transform and rotate the player we are also rotating the Met the same would apply to the scale and to the position also skew but I don't think anybody ever really uses skew anyway I don't want to do any of those things so let me reset all of them to fix that basically all we have to do is add the meteor as a child to the level which you can do by simply dragging it on top of the level and then the meteor is independent from the player or rather the Meteo is a sibling of the player so they would influence each other whatsoever which is a much better Behavior but anyway with that we have the most basic part of gdau next up we can work on some basic movement
Info
Channel: Net Ninja
Views: 29,209
Rating: undefined out of 5
Keywords: godot, godot tutorial, godot 4, godot crash course, godot 4 crash course, make games, tutorial, crash course, game maker
Id: q7wlSvt0JIc
Channel Id: undefined
Length: 19min 12sec (1152 seconds)
Published: Mon Jan 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.