How to Create a Hack'n'Slash Game in Godot 4 (step by step)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this tutorial Series where we will be creating this exact hacking slash game that you see on screen now let me quickly give you a simple walk through the game that we will be creating this is sort of a Lobby scene and at the top right we can see the score of our previous round and our high score nothing much is happening up here but if we jump down we land in this area the sky then darkens which signals that we are transitioning into the first wave of enemies wave one is simple as it is just four bats but once we defeat those bats we can see that we transition into wave two which spawns frogs along with more bats so each wave gets harder as the enemies have a multiplier that is increased every single wave the game lasts forever or for as long as the player stays alive this is wave 9 for you it's pretty overwhelming but once our player dies he has a little nice animation and responds at the top where the score is updated and we can jump right back in and play again really quickly I just want to cover some important information for this series there will be a minimum of three uploads per week so be ready every Tuesday Wednesday and Thursday and the occasional Saturday tutorials this entire course is completely free but if you do want to help support me a little bit more then I'll link to my patreon page will be in the description below and it really does mean more than the world if you have any questions about anything then let me know in the comments and I will be sure to help you out thanks remember to subscribe to help YouTube push this good hack and/ series to more aspiring game developers and let's begin okay so to get started with this tutorial we're going to go up here and we're going to click new in our gdau and we're going to name this project our hack in slash project because that's what it is we're going to name it that and then we're going to browse and I'm going to save it to my desktop select current folder create folder for a hacking SL game up here here and then we can go and click create and edit and it's going to load in Gau and it's going to launch it with a empty project for us now there are a couple things that I do want to go over here and some ways that we're going to organize first of all to organize we're going to create some folders we're going to have one folder that's going to be for our artwork and I'm going to tell you how you can get all that for completely free download it to your device so you can work through this with me step by step we're also going to have a folder for our scene and or for our scenes and then we're also going to have a folder for our scripts right those are the three main folders that we're going to get going with and get this project started off with now for the art the art is going to be a bunch of different things gathered from hiio so I have this folder right here and I'm going to drag it into our file system down here at the bottom and you're going to see that it's going to load in and it's going to be called base art straight from itch now the reason I named it because everything in here is straight from itch I didn't go and modify anything I didn't reorganize anything and I didn't do anything just because some of these art pieces have licenses to where I can't redistribute it right so you're going to have to go directly to the link and download it straight from the hi page so of course all the art in here we're not going to be using we're just going to be using some of it but I left it just like this so as we're going through the series it is going to look the exact same in your project as it is going to look in mine because I did not reorganize the art so everything should be organized these are going to be the folders you download so from one one hiio page you're going to download this folder from another you're going to download this folder from another you're going to download this folder and from another you're going to download this folder you can drag these into your uh project add them into a base art folder like this now I just did this on my computer so that's why it's called base art straight from itch but I'm going to take these four folders I'm going to move them into our art folder that we just created and then we can remove this base art folder here and again all of the links to these four different folders are going to be linked down below to all the four different hio pages to where you can go and download them so we can get going with this series and we can all have the same art and the same organization so everything the same and we can go through this step by step okay so let's start with episode one and let's keep it pretty basic today let's just start with the main scenes and create the tile maps and maybe the collisions for the scenes so our first scene we're going to go up here and we're going to click on 2D scene and we're going to name this scene our lobby level because this is going to be the lobby area this is going to be the starting level this is where we're going to come whenever the game is not currently in progress okay so then we can go to our lobby level and we can add in a tile map now this tile map is going to be the Island for our lobby world so we can click on tile set over here create a new tile set the tile size is going to be 32 by 32 because that is what our Sprite sheet is then if we come down here to the bottom we're going to see tile set we can click on that and we can drag in our tile set 36x 36 PNG which is going to be from a background folder and we can click yes and it's going to automatically create all these tiles so if we go to our tile map tab down here you're going to see that we can click on these tiles and we can drag and we can draw them if we zoom in very close they're going to be a little bit blurry and that is because we have to go up to our project project settings and we're going to actually have to change in our uh texture from linear to nearest if you see and we do that you're going to see that it automatically goes into a sharp pixel because it automatically adjusts the texture of the project right so yeah basically how we do it is we can drag and drop like this and we can just kind of draw out a little island and however we want to do it so let me draw one out real quick that looks right and I'll be right back okay so something like this looks pretty good for the ground now we're going to end up adding at home we're going to add some bushes and the bushes is what I want to go over next because the way that we're going to do the bushes right so up here at our lobby level we can just name this our ground tile map then we can go in and we can add in another tile map and this tile map is going to be called the bush tile map or we could call it the background tile map or something like that we'll call it the bush because the only thing we're going to be using it for is bushes so we can click on new tile set come over here create a new one this time we want to leave it at 16 by6 come down here to tile set and we can drag in our Bush Sprite sheet just like this and automatically create the tiles now the way that we're going to do this is going to be be a little bit different we're going to end up using layering right so the darker we're going to want to be in the back because we want those to show behind this bush so to do that we can go over here to our layers in the inspector and we can add in another element and we're just going to leave it as layer zero and layer one layer zero is going to one that shows behind and the layer one is going to show in front so for layer zero we can start with this type of bush right and we can add just add a corner right here and then we can add maybe a couple right here and remember we're going to want a house or something and it's going to cover up what's here so we can end it here and we can always come back and we can always change this up we can just keep this a straight line because the house should cover this up here come all the way down to the ground we can come out here maybe we want it to come more of like this way and then we want it to come out again and then maybe we want it to drop down here and then something like this right and then we can just end it there right cuz right here it looks a little funny but I promise it's going to come together as we keep on adding to our map now from layer zero we can go to layer one and we can add in some normal bushes these normal bushes we can start them from the ground maybe we want to start here and then maybe we can come up we can connect these just like this or maybe we want to go maybe or we can we can just leave it like this right but maybe we want to overlap this a little bit more maybe it it'll look a little bit better if we come and we start out here and then we come up up right here like this or maybe we can come and do a straight there like that and then we can try and go all the way up like this all the way over here and then maybe we can kind of like cut back down like this for sake maybe like this let's see how this looks it's going to cover up those those those uh barrels of course but maybe we can do something like this right and then we can go and we can put this behind this tile map because that's where it's going to be and you're going to kind of see it looks a little funny but it doesn't look bad and we we'll keep it like this we can always come back and we can always change it later on so make sure Bush tile map is above the ground tile map in the uh scene tree up here like this so it shows behind you're going to see that these bushes they're they're kind of like they're behind these bushes just like they should be but they're also look weird so let's go up here here and let's just drag in our house it's going to automatically create our house as a Sprite 2D which is exactly what we want and our house is going to almost look perfect already right so we can do something like this we can position it maybe right here and that looks fine and then we can go and we can just drag in our tree and we can throw our tree maybe right here and that is a scene that is pretty much set up for us right I want to go up here to our lobby and I want to add in a static body and the reason I'm going to do this static body is because this is going to be more of just a we're going to use this as sort of like a folder right so we can say our Sprites right our background Sprites or we can just call it our Sprites uh we we'll call it background Sprites something like this right just so we know and then we'll end up later adding our collisions or our major collisions within here just so it keeps everything a little bit more organized I want to also go in here and I want to add in our background which is going to be for now just a normal background later on in this series when we go over Parallax backgrounds we're going to end up changing this into a parallax background but for now I just want to leave it just like this maybe we can drag it a little bit down like this put it all the way above our Bush tile map just so we can't really see anything else and that's going to look pretty good right so that is our scene one this is our lobby scene this is our lobby level we're going to keep it here for now we're always going to come back and we're going to make changes and adjustments to it later on in the series to make it fit more of what we're doing but we can save the scene by clicking crl s we just make sure we save this into our scenes folder just like that and then we can come up here to the top we're going to create another 2D scene I'm going to move this through I'm going to move through this one a little bit quicker just because it is kind of the same thing that we're going to be doing but we're going to call this our stage level and this stage level is going to actually be a little easier than the other level it's just going to consist of a tile map and it's going to consist of the background but the tile map here is going to be a little bit more complex but we're going to do it in the exact same fashion right so actually it's not going to be more complex all we're going to be doing is using two layers one for the fences and then one for the Rocks just so we can have rocks and fences overlaid I'll kind of explain that here in just a minute but if we go over here and we click on tile set we create a new tile set come down here we're just going to use the exact same tile set that we used last time and we're going to create all the same tiles and we forgot to change it so let's remove this let's go up here let's change this by 32 by 32 and then let's drag in our tile set again automatically create the tiles and you're going to see that everything is going to come up okay and then now I'm going to go into a time lapse real quick and we're going to do this the exact same way I'm just going to hop out of time lapse whenever we start to do the separate layering so we can go over the layering one more time together but I'll be right back once I just kind of lay out some basic settings of our map right okay so this is some basic grounding for our level now what I want to go over is I want to go over these rocks right so we have these rocks here and we have these fences now we're going to have to do one of these on a separate level because we want something to be in front of the other right so we're going to want the rocks to be in front of the fence so we're going to put the F fences here on level zero so when we go to layer one we can put the rocks and the fences are just going to we can throw in some random ones wherever we want and then we can fill in the rest with the other ones so it kind of looks like they're a little different throughout the entire thing and it gives it more of this like rundown kind of like jaggedy look more than just like a perfectly straight you know fake looking fence cuz no fence is perfectly like the exact same every single one they're all going to be different so that's what we're going to do and then we can switch over here to layer zero or layer one and then we can add in some rocks maybe we want a big rock maybe we want some small rocks maybe we want one more big rock something like this right now if we it's going to look kind of blurred out so it's going to look a little funny but if we go and we click in our stage level up here you're going to see that it kind of looks like a stage level and how it's supposed to be so that looks good then we can go up here and we can add in again whoops I don't know why I'm going up in there I'm meant to drag in this background here this background spr and these background Sprites they're they they're going to look a little funny right now just because of the way that we have them set up and we're just throwing them in there just for for looks right now but eventually these are going to be parallx backgrounds right so they're going to be parallx backgrounds and they're going to move as we walk around just like this that you see on screen now right so it's like a parallax background and they're going to look a little bit more advanced but for now we're just going to leave it like this we can save this scene into our scenes folder and then real quick the final thing I want to go over is some collisions so for collisions we're going to add in a static body we can name the static body our collisions and we can end up adding in a collision Collision shape 2D and for this level we can add in a rectangle right so we can add in a rectangle and we're just going to drag and drop this rectangle just like this we want the player not to walk way up here but we want him to walk Midway through the level so we're going to stop the Collision halfway in the grass so it looks like the player is actually walking on the grass and not walking on top of the grass right so we can extend this and we can make this our level just like this and of course we can't have our player walking on and off of the level so we can name this here our ground collision and then we can end up adding in another Collision shape 2D just like this and this Collision shape 2D is going to be a rectangle as well and we don't we we want to be able to walk on this wall but we don't want to be able to walk off the map right and we're going to make this is all going to look better once we cameras but for now we can say something like this and we can say left left wall Collision shape right and then we can add in another Collision shape 2D and we can make this another rectangle and we can come over here and we can drag and drop this on this side like this right over this area so that we can't walk off this edge of the map either and then we can come over here and we can name this one right wall collision and that can be saved and this is going to be our scene this is our stage scene for now this is all we're going to need for now then we can come up here to our lobby level and we can set up some basic collisions over here so this one's going to be a little bit different because our player is going to jump off and we want our player to fall down here but we don't want our player to be able to jump all the way out here so we're going to add in a big old Collision shape right here so to do this we're going to add in another static body this static body is going to be named again collisions and we're going to use a a collision polygon this time and so to do this we're going to click where we want so remember that we want our player to walk in the middle of the grass so we can start it right here in the middle of the grass come over here to the edge and then we can once we get to the edge we can drag it all the way down just like this until the very very bottom of our area then I want to wrap it this way because you remember we cannot have our player jumping too far out on this angle so we can drag it up here like this and then we can come across like this come all the way down come all the way out here and all the way back around to where we want it to stop so we want a wall on this edge of our map so we can come down here we can draw this wall and where do we want our player to walk we remember we want our player to walk in the middle of the grass so we can stop it there and then we can follow along and connect it with this one by clicking it and you're going to see that it's going to make a big old Collision for us it's going to make this all Collision everything that's colored here is going to be Collision so now we can walk here and we can jump down this area but we can't go all the way off the map and eventually we're going to have an area 2D here which is going to catch our player when it's jumping and everything is going to be good so if we click play you're going to see that it has our scene and that is our scene that is our very first scene of our game and we also can come over here to stage level and click F6 to play and you're going to see that we have our scene so camera and stuff is not set up yet of course but this is only episode one we just want to go over some of the basics some of the beginning stuff some of the setup stuff that we're going to need for future episodes and I hope this video was able to kind of get you started with this series and I really know that this series is going to be so beneficial to learning the gdau engine and learning about how to create a hacking slash game so I want to thank you guys so much for watching next episode we're going to be going over the player and we're going to be going over camera so that's going to be pretty important and in then stay safe have a wonderful rest of your day and if you have any questions then please let me know in the comments down below thank you so much and I cannot wait to see you next time stay safe and bye-bye [Music]
Info
Channel: DevWorm
Views: 6,228
Rating: undefined out of 5
Keywords: godot, Godot, godot 4, game development, godot course, godot tutorial, godot how to, how to make a game in godot, hack'n'slash game in godot, godot how to make a 2d game, step by step game series in godot, godot hack and slash 2d, hack and slash, hack n slash, hack and slash step by step, godot step by step, godot beginner tutorial, godot full guide, combat in godot, combat system in godot, how to make enemies in godot, fighting in godot 2d, godot combat game, how to godot
Id: 6F4l8efwnUc
Channel Id: undefined
Length: 17min 42sec (1062 seconds)
Published: Fri May 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.