Publish Your First Game Using Godot and Free Assets | Thomas Gervraud | Skillshare
Drawer
Search

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Publish Your First Game Using Godot and Free Assets

teacher avatar Thomas Gervraud, Indie Game Developer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      Intro

      0:46

    • 2.

      Finding Free Assets and Tools

      3:35

    • 3.

      Setting Up Our Project in Godot

      7:49

    • 4.

      Player

      9:17

    • 5.

      Enemies

      8:43

    • 6.

      Explosion Effect

      5:21

    • 7.

      Scoring System

      4:46

    • 8.

      Menu

      4:45

    • 9.

      Highscore and Music

      4:23

    • 10.

      Exporting and Publishing

      5:40

    • 11.

      Outro

      1:04

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

390

Students

5

Projects

About This Class

This short class will teach you how to make and publish games using only free tools and assets.

We'll create a simple game with the Godot engine which is totally free and open-source. It's one of the best engines to get started with game development. A lot of the concepts you'll learn here will be useful to you even if you decide to switch to another one like Unity or Unreal later.

By the end of the class, you'll have made a fully functional game and published it on a website called itch.io.

Releasing your games there is a great way to get started with game development, receive feedback from players and even make a bit of money since you're able to accept donations or sell your games.

Along the way, here's exactly what you'll learn:

  • Where to find free assets and resources for your games
  • The basics of the Godot engine
  • How to make a game world with a player and enemies
  • How to make a scoring system with a highscore
  • How to make a simple menu screen
  • How to make an explosion effect
  • How to export and publish your game on itch.io so that everyone can play it
  • How to use input mapping
  • How to use autoload scripts to make data globally available in your game

This class is aimed at complete beginners so you don't need to know anything about game development although knowing the basics of scripting would definitely help.

Feel free to check out my Programming for Beginners class if you want a quick introduction to 4 important programming concepts.

So, if you're up for the challenge... join the class! I'll see you there!

Meet Your Teacher

Teacher Profile Image

Thomas Gervraud

Indie Game Developer

Teacher

Hello! I'm Thomas aka Blobfish, an indie game developer since late 2018.

See full profile

Level: Beginner

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Intro: Class, I'm going to teach you how to make and publish a simple game using only free tools and assets. Along the way, we'll learn about the basics of a free and open source game engine called goodwill. We'll see how to create a few things, including a game world with a player and enemies were scoring system with the high score, a simple menu screen and exclusion effect. And how to publish your game on each dot IU so that everyone can play. My name is Thomas, also known as Blowfish, and I'm an indie game developer. I made two games, space gladiators and loss potato that you can find on Steam. Class is aimed at complete beginners. So you don't need to know anything about gender development for knowing the basics of programming would definitely help. So if you're interested, Let's start by taking a look at where we can find free resources to make our game. 2. Finding Free Assets and Tools: You don't need to spend any money to create your first games and you don't need to know how to do everything. First of all, we need a game engine, which is the program will use to make the game. Most engines have a free version like Unity or Unreal, but some of them are totally free, like good of which is the one we'll be using in this class. Next, we need to get assets for games. This includes images, sounds, music, and fonts. And either make them ourselves or find ready-made assets on the Internet. Those assets will usually be released under a specific creative commons license, which restrict what we can do with a note that I am not a lawyer. So take everything I say with a grain of salt. From my understanding, the CC 0 license is the most permissive one. And every asset you find realists and that is licensed, should be safe to use in your games. But the licenses might, for example, require you to give credit to the author of forbid you to use the assets in commercial projects. With that said, let's see what we can find those assets. For art assets, we can go to Jenny dot, nl. Every asset in here is released and the other CC 0 license, they made a lot of asset backs that can be used to create full mini games. And they're often used for prototypes and game jams. For game will use assets from the pixel, should they not like another website where you can find free art is opened game out.org. But you have to check the license of each asset that you don't lose individually, then there are different assets stores that offer free and paid assets, like the Unity Asset Store. Again, they've market is you want to create your own art. You have a lot of free options. I use Krita for drawing the 2D out of my games, which looks a lot like Photoshop, but it's totally free. If you want to do pixel out, you can use the scale, which words directly in your browser or graphic scale. Finally, for 3D, you can use Blender, but I wouldn't recommend starting with that. If you don't know anything about Tim development yet, for sounds, you can go to freesound.org. But again, you need to check the license because you might have to get credits. Kenneth dot nl also have some CC Zero sounds we can use in our game, will use one from the sci-fi sounds, but we can also use a small tool called the fixer to create sounds very easily that you can use however you want. Afterwards. Music, you can find public domain music overlaps three pd.com. Please attract from here, called Made by Kevin meglio. We can also find a lot of free music over on given music dot IU. If you don't mind giving attribution to decomposers and if you want to make your own music easily, does a small app called both Cassio that allows you to make some small tunes for fonts. We can use the Google fonts library, where all the fonts are released under the same license. That allows us to use them freely in our games, we'll be using the cellae one font from here in our game. We can also go to definitely.com, which has a larger library of fonts, but you have to check each license individually before using them. Finally, there are a few platforms. Well, we can publish our games for free. Some great wants to get started on each dot IU and Jim Jones, we'll publish our game on each dot IU at the end of the class. And I've attached to the class all of the resources will need for game, including the art, sounds, music. And I also created the logo file, thumbnail, and screenshots from the assets that will be useful when we get to uploading or game to each, feel free to go through the websites yourself and download different assets. If you want to, you'll find all of the links in the resources section. Okay, now that we've seen a quick overview of all of the tools available to us and that we don't know that all the assets we need has installed and setup or project. 3. Setting Up Our Project in Godot: In this class we are going to make a simple game called plain survival, where you control this little plane at the bottom of the screen and you have to avoid the enemy planes that are coming down. Every plane you avoid will give you 1, and the game will store your high score on a simple menu screen. So to get started, we're first going to download go do. So, go to, go to engine.org and you'll end up on this page. Next, click on the Download button at the top right of the screen and select the version that corresponds to a computer. For me, it's going to be the 64 bit version. It will download a zip file into your computer. So extract it and logical do. And you'll end up on this page, which is the Godot project manager. You will see a list of all of the projects that you have created with Hadoop. So for you it will be empty. And we're going to click on New Project. I'm going to name it plain survival. And I'm going to pick a bath on my computer to save it and then click on create and edit. Now that we've created a project, we are on the main page of the photo editor, which has a few different tabs. So there is the scene view in the middle of the screen. On the left, we can see the scene tree, which will be a list of all of the components that are present in our scene. And below that, we have defined system which lists all of the files that are in the project. On the right of the screen, we can see the Inspector tab that we list a bunch of properties that we can modify about the components that will be soliton in awesome. And at the top of the screen there are a few times where we can switch between the 3D view and the 2D view. So let's go to the 2D view, which will be the one we'll be using throughout the class. And now we're going to import the assets that we've done, wrote it earlier into a project. So before we can do that, we need to tweak some import settings. Let's first drag the icon that PNG file that's already know project into the scene and click on the import tab at the top left of the screen, right. Now if we import assets into our game, it will apply some anti-aliasing by default, which is the effect that smooth out the lines of our images. It makes them appear on the library like this, which is good for HD odd, but since we are using pixelate, it will mess up all of our textures, so we need to disable it. We can do that by clicking on Presets and selecting 2D pixel. And now if we click on reimport with the icon that PNG file selected, you can see that now we appear sharper. Next we'll set the setting as the default for a product. So click on Presets and click on Set as Default. And now we can import all of our files. So I'm going to find the asset folder that I've attached to the class in the File Explorer. And I'm going to drag it into the project, which will import all of the files inside of it. So now I have a new folder in my project called assets. And inside that folder, I have two other folders called in-game packaging. Instead of packaging, I've put a thumbnail and some screenshots of our final game, which will be used when we get to uploading it to each. So we don't need to worry about it now. And instead of the in-game folder, there's everything will need to create our game. So we need to tweak a couple more settings before we can create offers in. So first click on the explosion sound. This is the sound will play when the player dies and when we import sounds into Godot, they are set to loop by default, but we want to play, it only wants. So we need to disable it for the sound. So disable the loop property and click on reimport. We also need to modify the 56 dot PNG file. This is the title that we'll use as the background of our game. So we needed to appear multiple times to set our background. And to do that, we need to enable a property in the import settings, which is called repeat under the flags category. So it's currently a disabled. We're going to put it at enabled and you click on reimport. Now we can remove it from our sin. And we're going to create our first scene. So if we go back to the scene tab, we can also delete the icon sprite that we added earlier, and we're going to create a root node for sin. So click on or the node and select the base node. Empty concrete. And we're going to rename it to world. Every node in Gueckedou can give us some functionalities. But for now we've selected the base node. So it doesn't do anything in particular. And we're going to save us in Ubuntu scene and click on Save Scene. Here we're going to right-click and create a new folder called seems to stay organized. And we're going to save our scene as well, the TCM inside of it. So he can save. The scene will basically contain our whole game. Instead of it will have the player and the enemies Bonnie. And then we'll have another scene for the menu. For now, we can run the scene by clicking on the play button at the top right of the screen, are pressing the F5 shortcut. If we do that, good, it will ask us to select a main scene. So we're going to select our world scene. And then it will run this. So now what we're going to do is to tweak some project settings to that, our game appear in the vertical window and with the resolution that fits our pixel up, so close the window and I'm going to add the icon back into the scene just to show you what modifying the settings will do. So if I put it at the top-left of the scene and then we go to Project Settings. And then if we go down a bit until we find the display category and the window page, we'll see a bunch of properties that we can modify about the window that runs our game. So first, we're going to change the width and the height to one hundred and eighty and three hundred and twenty. Now if we launch our game, it would be really small. Two, this is the right resolution for assets, but we want to make the window bigger so that it expands everything so that we can see better. To control the size of the window, we need to modify the test width and height property. So the width and height will be the resolution of a game, and the test width and height will be the size of a window. So we're going to make it twice as B. So we can just type 180 times 2320 times 2. So now our window is twice the size of our resolution. But the problem is that it doesn't expand our game. This is just actually empty space to better see it, I can stretch the logo to take the whole game. And also again, we can see that our game only appears in the top-left corner of a window. So to fix that, we need to go back to predict selling. And if we go down to the bottom of the page, we can see some stretch properties. So we need to change the mode from disabled to 2D. This way, again will stretch to take up the entire window. So now it works. The problem is that we can stretch it and changed its aspect ratio to be any value, which makes our game very ugly. So you can see that by changing the aspect property from ignorance to keep. This way, when we change the size of the window, it will create some black bars around it instead of stretching the game too. Now I'm going to remove the icon and we're going to set the background of our world. So to do that, I can either drag the 56 that PNG file into our scene. I can right-click on the word root node and click on Add. And then I can search for Sprite and select the sprite node and click on create, which will add a sprite node to our scene. I'm going to rename it to background. And I'm going to assign the tile 56, that PNG file as the texture of our sprites. So now we want displayed to take up the whole screen and to be tiled. So we don't want it to stretch like this because it will only be one image stretched instead of the semi-major repeating multiple times. So what we need to do is to first go to the offset category in the Inspector tab. And we're going to teach the centered property and x me to go to the region category and enable it. So our image has disappeared, but then we can set the size that we want the image to cover. And since we've enabled the repeat property, it will just repeat over the size that we set it to. So you can set the width to a 180 and the height to 320. And now it repeats correctly across the whole screen. Can also modify its brightness a little bit because I've needed a bit too bright. So we can do that in the Canvas item and visibility category. And here we have a moderate property which is currently set to white. And if we lower the brightness here, it will apply it to our image. Finally, I'm going to click on the background. I'm going to click on this little lock so that when we add stuff on top of it, we don't select it by mistake. So now that our world is set up, we're going to add our player. 4. Player: To create our player, we're going to add a new sim. So in the file system, in the Scenes folder, we're going to right-click and create a new sim card player. Then we're going to click on other node here and select the area to denote. So this is the node that will represent our player. An area to D gives us some functionalities that allows us to detect the collision with other areas. Now click on Create and rename it to player and safety. And we can see there's a little warning signs that appear next to our node. And it's because the area to denote needs a child node of type collision shape to D so that it can detect collisions with other stuff goes right now, it doesn't know what the shape of our player. So right-click on the play on node and add a child node which will be of type collision shape to select it and click on Create. And now the warning sign disappeared on our player note. But there's another one that appeared next to our collision shape to denote and is because we need to assign a shape to this node, which we can do on the right in the Inspector tab. And the shape property. Right now it's empty and we're going to select a rectangle shape 2D, which is just a rectangle. So now our player node has a sheep, but we also want to assign the image to it. So right-click on the player node again and click on Add child node. We're going to add a sprite node. So click on Sprite and creates, and we're going to assign the sheep 0, that PNG file to the texture property of this node. So now our player has a sprite and it can collide. Now we are going to add some code to make it move. When we press the arrow keys to do that me to attach a script to the root node of our sin. So if you click on the player node and click on this little button, it will attach a new script to the node. We're going to use the d discrete programming language and we are going to the template to empty and we'll press Create. This has created a new file next to our player sim, which is called player the GDI, which contains all of the code that we write in this editor. And all of the code we write here will be applied to a play on node. As you can see, there's a little icon that appears next to it, means there's a script that's attached to it. So we're going to add a bit of good to be able to move a player. So I'm going to write a function which defines a new function, which is a bit of code that will be processed at a certain time depending on the function. So if I write underscore process, you can see that the auto-completion gives me the name of the function. And if you press on it, will read it for you. And dysfunction happens every frame of our game switch your game runs at 60 FPS, 60 times per second. It could be more or less depending on the frame rate of your game. Now we need to add a line of code to retrieve the inputs of the player. To do that, we're going to create a new variable by writing var and limited input. And we're going to assign a value to it by writing the equals sign. And inside of it we need to retrieve whether the user has pressed the arrow keys or not. So to do that, we can write the input layer this with a capital letter, then dot, and then get underscore action. And thus core strength is a function that God gives us to get whether the player is pressing a key or not. So it will return one if a key is pressed or 0, It's not breast, and we need to give it the key that we want to check. So open the parentheses and we can see a bunch of actions that we can give to it. Those actions are created by default for a project. And there are some keys that are assigned to each of them, but we can add our own or modify them however we want. For now I'm going to select UI, right, which is basically the right arrow key. And I'm going to subtract from it the left arrow key. So copy this and paste it. And then I'm going to read you, I left instead of you, I read, since this function gives us 1 or 0, depending on whether the key is pressed on, it is expression will give us one if the player is trained to go to the right minus one if they are trained to go to the left and 0 if they are not moving. Now we need to apply this input position of our player node. So to do that, we can just use the position keyword inside of it. We have access to the x and y variables. So we just wanted the player to move horizontally. So we're going to modify the x variable and we're going to write the equation that x equals position that x plus input. Since all of this happens more than 60 times a second, every frame that the player would be pressing a key will be able to change the x position of the player node. So if you want to try that for login to save our script and save our scene. And we're going to go back to the world scene and to the 2D view. And we're going to add the payer inside of our world so he can drag the player, the TAC and file inside of our scene. And we're going to play a note at the bottom of the screen. To make it easier, we can toggle snapping and I'm going to place it around here. Now we can launch it again to see for code worked. And if I press the arrow keys, you can see that our player is moving. Now there are a few problems since the process function happens so many times every second player is going a bit fast and we need a better way to be able to control its speed. And another problem is that if you have a fast computer, the player will actually go faster than if you have a slow computer, because it will be able to display more frames per second. So it's not really fair and we need to fix it. So if we go back to our player, the GD script, by double-clicking on it. We can fix the issue of the slow and fast computers by using the Delta variable that good or gives us in this function. And this variable contains the amount of time that has passed since the last frame was drawn on your computer. So if your computer is faster and draws more frames, the value of delta will be lower. But if your computer is really slow and draws only a few frames every second, the value of delta will be higher to compensate for it. So all we need to do is to multiply the input value by delta. So now if we run the game will see that our player moves really slowly is because the delta value is really small. So we're going to add another variable that will allow us to control the speed of a player. I'm going to add it before the function, and I'm going to write export that equals 250. So putting it here and writing exports will make it so that when I select the player node in my players, in the speed variable will appear in the Inspector tab is where I can modify it directly from here instead of going to the code to modify it. And now that we've created this variable, we just need to add it to the expression. So times speed. And now every frame we'll move the player by the input. So between minus 11 times delta, which is the amount of time that passed since the last frame times the speed variable life we launch the game. Player is moving at a good speed, but now there are new problems. The player can actually move out of the screen. So we need to limit its position to be inside the values of the screen. So it means we need this position, not go lower than 0 and not go higher than a 180, which is the width of our game. So to do that, we can use a new function. But first, I'm going to put all of this into a variable to make it easier to read. So I'm going to write var new position equals, and I'm going to cut this and paste it here. And now instead of new position here, I'm going to write clump, which is the function will use, and we need to give it three arguments. So first the value that we want to clamp, so here it will be new position. And next we need to get the minimum and maximum values that it can have. Joy we want the minimum to be 0 and the maximum to be a 180. Now if we launch the game, we can see that it kind of works. But we can get half of the player outside of the screen is because the position that x of our node is at the center of our player. So the center of our player will never go out to the screen, but the size of it can still go out to the screen. To avoid that, we need to add half of the width of the sprite to the lower value and remove half of the width of the sprite to the higher value. We want to do that. We need to get the width of the sprite. So I'm going to create a new variable called Health widths. And here we need to get the width of the sprite of the player. So to do it, I can write the dollar sign. And here you can see that the auto-completion give me a list of all of the children nodes of the current node is the play on it. So there's the collision shape and the sprites. So I can just select the sprite and if I dot, I can get texture property of the spread, which is the image that we assign here. And if I write dot again, I have a function that can give me the width of this texture, which is called getWidth. And finally, I'm going to divide this by two so I can get help for this width and we need to add it into the clump function to instead of having a minimum value of 0, we're going to have a minimum value of half width. And we're going to subtract half width from the maximum value of the Crump. So now if we lost the game, we can see that our player stays within the boundaries of our game. One last thing I want to do is to make the player be controllable with the WASD keys instead of only the arrows because it's a bit annoying. So to do that, I can go to the Project tab in Project Settings. And then inside the input map tab, here we have a list of all of the actions available in our game with all of the keys that are assigned to them. And if I go down a bit, I can find UI left and right, which are the one we used in our code. And if I click on the little plus icon next to you, I write, I can add a key. And if I press D and press Okay, now, instead of just being able to press the right arrow key, I can also press the DT and goodwill, detect it as the same. I'm going to do the same thing for the left key with the 80. Now if I close this window and lost the game again, I'm able to control the player with the AND T. So now that our player is working, we're going to add some enemies into our game. 5. Enemies: Now we're going to add some enemies into our game. First, don't forget to save everything. And I'm going to add a new scene into our scenes folder. So right-click on since creating a new scene, call it enemy. Just like for a player, we're going to add an area to denote. So click on other node, right area to the area to the node and we can create, rename it to enemy and save the scene. Next we'll add a child node of type collision shape. Today. We're going to assign a rectangle shape again. Also going to add a sprite. Sprite and click on Create. We're going to assign the sheep nine, the PNG file to the texture property of the sprite. And we're going to rotate it so that it looks down. So we're going to go into the node 2D category in the Transform category, and we'll change the rotation degrees property to a 180. Next will also attach a script to this node so that it can move to click on the NMI root node and click on the button and click on Create. We're going to add the process function again. So, right, func, process can use the auto-completion instead of it. This time we're going to modify the position y. Variable costs are enemies will go down. So we need to modify their vertical axis and then equals position dot-dot-dot plus speed times delta. If we add to the y position of the enemy, it means they are going down because the axis are reversed in games and we need to define the speed variable. So we're going to do just like we did for our player and define it above the function by writing export speed equals 250, and then save our file and save our scene. And now if we click on this button or press F6, it will play the current scene. That way we can test our enemy without having to test the world scene at the same time. We can see that it goes down, so it's working. Now we'll go back to the world scene, go back to the 2D view, and we'll read some good to spawn the enemies at top of the screen. To do that, we need to add another node to our scene. So click on the word node, click on Add childhood and write dimer. So this is a specific node that will come down and allow us to do some things, wants the timer has ended. So click on Create. We're going to rename it to spawn dimer. And we can see the properties it has on the right of the screen. Right now it will end after 1 second and we'll actually make it so that it starts. So when we use the game, it will start directly and we're not going to enable one-shot. This means it will loop indefinitely, and every time it finishes, we're going to spend some enemies. So to do that, we're going to attach the script to the world node. So click on the word node and become attached, and click on Create. And that we need to add a function inside of the script that will run when the timer, and I can click on the timer node. And if you look on the right of your screen next to the Inspector tab, we actually have a node tab. If we click on it, we have a list of signals. Signals are events that happened for this node at different times. And depending on the type of the node, will have different signals. Since this is a timer node, we have one specific signal to this type of node, which is called time-out. And the signal will be emitted when the timer reaches 020. To write a function that responds to this signal being emitted. To do that, we can click on the signal and click on Connect. The bottom right of the screen, we'll have a new window that shows us that we are trying to from the respond timer. And we're going to connect it to the world script, the one that we've just created. And if we do that, it will create a function called unspanned timer timeout, which is where we'll be able to write our code to respond to the signal. So if we click on Connect, it has created a function for us called unspoiled timer timeout. And we're going to write some code here to spawn some enemies. But first we need to retrieve the enemy seen that we've created to jointly our enemy seen is the enemy that JSON file that's in our scenes folder. There are multiple ways to do it, but here before the function we're going to write export. Any missing. And then colon and packed scene. When we read columns like this after the name of a variable, it means we are specifying what type this variable should be. And the type scene just means a scene in Godot. Since we've written it here with the export keyword, will be able to modify this variable in the inspector. So if you click on the word node and go back to the Inspector tab, you can see that the enemies in property has appeared and now we can drag the enemies scene file inside of this property. So now this variable will contain our enemies in, and we'll use it to spawn enemies. To do that, I'm going to replace this line of code and I'm going to create a new variable called enemy. And I'm going to assign an instance of the enemy seem to this variable. So to do that, I'm going to write enemy seen. That instance with parenthesis, meaning we retrieve our enemy scene and called the instance function on it, which will create one enemy from the scene. Next, we need to add this enemy instance to our scene. So I'm going to write add child enemy, which will add this node as a child of our world and node inside of our scene. If we don't write this, it will not appear in the scene. And finally, we need to tell it to spawn at the top of the screen. So I'm going to write an immediate position equals, and we're going to create a new vector 2, which is just a couple of values which represent the x and the y axis. So write the vector to open the parenthesis. And here, if we write 900 to reset the position of our enemies to be 90 on the x-axis and 0 on the y axis. So at the top of the screen and in the middle of the horizontal axis, if we try to run our game now should already work. But instead of being at the center of the screen, we want it to be a random number between 0 to the left of the screen and a 180, which is the right of our screen. So we can replace 90 with another function is called rent underscore range. And then we give it two numbers, and then it will give us a random number between those two numbers. So here we can write 1070. This way our enemies will not spend with half of the sprite outside of the screen. Because just like for a player, this corresponds to the center of the enemy node. We could also retrieve the width of the sprite of the enemy, but for simplicity sake, so I'm just going to ballpark it. Now if we run the game again, the enemies will spawn at random positions. To make the game a bit more interesting, we want to spend three enemies every time instead of only one to two, is that we can use a loop. So before everything, I'm going to write for y in three and then colon. And if we move everything else to the right by selecting it and pressing Tab, all of this will happen inside of the loop. And right now the loop will happen three times. So it means it will spend three enemies. We can test it and we can see that it works even if sometimes they have basically the same position. So they appear one on top of the other. But it's fine for our purposes. And I want to make it so the player dies if they touch an enemy. Before that, we need to fix another small issue that I'll show you right now. So if we launch the game, we can see the two tabs under the skin touch in our editor, which are called remote and local. Local represents all of the nodes that we've put in the editor. And remote will show us what is currently happening in the game that's running. So since we're spawning enemies, we can see that there are a lot of enemy nodes that have been created. And the longer we played the game, the monitors they will be, at some point, there will be so many nodes that are computer might slow down or even crash. So we need to delete those nodes once they are out of the screen because they are no longer useful, but they still exist somewhere, even if we don't see them. So to do that, we need to go to our enemies, him, and we're going to add a new child node. So right-click on the enemy node, click on Add channel. And this one would be called a visibility notify or 2D. This is a node that will emit a signal when it leaves the screen. So if you go to the node tab on the right of the screen, we can see that for new signals that we can connect two, we're going to use the screen exited signal and connect it to the enemy script. This has created a new function inside of it. We are going to destroy our enemy. So we can just write Q free. Dysfunction will free the node and remove it. Now if we launch the game again on the remote tab, we see that it never goes above a few enemies because they are getting deleted when they leave the screen. So we've just avoided a lot of potential performance issues. Now we can finally add the collision between the player and our enemies. So we'll go to our player scene. And if we click on the play on node is an area. We also have a bunch of signals that we can connect to. And here we're going to connect to the area. And third signal, which will be emitted when this area collides with another area. So when our player touches enemies is signal will be emitted 35, click on Connect and connect it inside of the player script. We've created a new function called Peoria entered, and we can destroy the player here by writing Q3. Now, we can launch the game and stdout. And when we touch, enemies are getting destroyed. Now it's a bit brutal. So we're going to add an explosion effect when that happens. 6. Explosion Effect: Now we're going to create an explosion effect. So go back to the Scenes folder and we're going to create a new scene called explosion. This is going to be a node of type particles to be sure to select particular study and at CPU particular study, and click on create, rename it, explosion, and save it. We can see the little warning sign next to the node because we need to add a material to our particles to denote, to go back to the Inspector tab. And inside the process material category, we're going to create a new particles material. We can see that it has added some default values to a particle. So the first thing we'll do is change the spread of a particle. So in the textures category, we're going to assign the five-thirds PNG file to our texture and x, we need to modify some properties to make it look like an explosion. So first, we're going to change the amount from eight to 20. And in the time category at the end will enable one shot. But it's not really practical for designing the particle. So for now, we'll leave it off and turn back emitting. We're going to set the explosiveness to one and the lifetime to 0.5. Next will go inside of the material by clicking on the material field, which will open some new properties. And here we'll change some things in the direction category. We'll set the spread to a 180. Then in gravity, we're going to set everything to 0 because we don't want our particles to be affected by gravity. And we're going to set the values in the initial velocity category. So the velocity is going to be 200 and the velocity randomness is going to be 0.5. Now I think it looks pretty good. Feel free to modify it more if you want to. I'm going to save the scene. And we want this effect to play when the player dies. But if we go back to the player scene and we add it directly here by dragging the explosion that JSON file under the player node, it will not work because first, the explosion will follow the player and when the player disappears, the explosion will disappear as well. So we don't want it to be here. And also in the explosion scene, we forgot to enable one shot. So do that now and save the scene. And we're going to remove the explosion scene from the Pliocene, so just deleted. So what we'll do instead is crater on signal that will be emitted when the player dies. And inside of the word sin, we're going to connect to it and create the explosion there. So we can actually create our own signal. We go back to the player, the GD script by clicking on the little icon next to the player node, we can write above the speed variable definition, signal. Died. The signal keyword recreate a sinner and we can emit it here before destroying the player by writing emit signal. And then the name of our signal so died. Now if we save this file and save or Pliocene, we can go to the world scene and we'll be able to connect to the signal. So in the word sin, if you click on the player child node and go to the node tab, you can see that we have a signal that we've created here. So we can connect to it just like we've connected to other built-in signals. So click on dyed, can connect and connect it to the world script, which has created a new function called on player died. Now in here we want to show an explosion. So what we'll do is add the explosion seem as a child of the word node. And then if we go back to the word script, we can get the exclusion node by writing a dollar sign, just like we did before for the player sprite and writing explosion. So this represents our extrusion node. We can set its position. So right, third position equals, and we can assign the explosion position to the player position when he dies. So by dollar sign, player dot position. And then since our explosion is set to, one shot is not currently emitting. So we just need to turn on emitting, which will make it play wants to go back to the script and write explosion that emitting equals true. Save the script and save the scene. And if we launch the game, you can see that our explosion place at the right time. Now we also want to play a sound when the explosion is shown. So to do that, we're going to add a new child node to the word. Node, is going to be a node of type. String player. Select audio stream player, I click on Create. We're going to rename it to explosion sound. And we are going to assign to each stream property the explosion crunch. Some file can also lower the volume a little bit. So I'm going to put it at minus 10 and we can toggle playing to test it. And in often player died function, we're going to play the sounds as well. So I'm going to write dollar sign explosion sound and play. The game, will see that it works. And finally, we want to restart the game when the player dies after the explosion, effects have played. So I'm just going to select the explosion some node and the node tab. I'm going to connect the finished signal to the world script. So click on Connect, select the world script we can connect. And here I'm going to call a function called get three, which gives us an object that represents the current scene tree that gives us some functionalities. And I'm going to write that we load current scene, which will restart the game. Now we can try it. And it works. So now that it's done, we're going to add a scoring system. 7. Scoring System: So now let's go back to the 2D view of the world scene. And we're going to add a new child node of type canvas layer. Click on Create. And this is where we'll put all of our interface. Everything we put in here will appear in front of everything else. So for our game will just need to display the score inside of it. So select the converse layer and add a child node of type label, which is a simple text we can create. And I'm going to rename it to score label. In the Inspector tab, we have a text property for now I'm just going to write 0 that represents the current score of the player. I'm going to align it to the center, and I'm going to click on the Layout button here and select the top wide alignment weights center at the top of our screen. I'm also going to align it vertically. And I'm going to increase the height of a label a little bit like this. So now the default font is a bit ugly, so we can create our own instead. We have a fourt file here, but we need to create a fourth asset that Godot can recognize. So right-click in the in-game folder and click on new resource. We're going to write font and select Dynamic font you can create. I'm going to name it custom fonts and save. And if we click on it, you can see there are some properties in the inspector. I'm going to open the Settings category that I'm going to set the size to 18, the outline size two to the outline color black. And in the fourth category, I'm going to drag the file that we've downloaded inside of this property. And now we need to assign this custom fought to our label, to click on the score label. And if we go down a bit in the inspector, we can see there the custom fonts category. If we open it, we can enable it. And we can drag our custom font resource inside this property. To now it has updated the fourth used in a label. So now it will only display 0, but we need to update it when an enemy plane leaves the screen at the bottom. And every time that happens, we need to add 1 to the score is we're going to go back to the enemy scene. And we're going to modify the enemy script by adding a new signal, which we'll call screen exited. And it will emit the signal before deleting them in their own visibility notified to the screen exited function. So we're going to emit screen exited and save this file. And next in the world seen inside of the word script, when we spawn the enemies, we can connect to that screen exited signal. This way we'll be able to respond to that event and add to the global score. To do that, we need to add the line after spawning each enemy still inside of the loop function, because we need to happen for every enemy. And we're going to write enemy dot connect. And then the name of the signal that we want to connect to. So it's going to be screen exceeded and we need to give it the script where we want to connect it. So it is will be self, which means the script because we want to connect it to the world node and script, and then the name of the function that will respond to the signal. So we're going to write underscore on NME exceeded to stay current with the other functions. And next we need to create this function. So just above the non-periodic function, I'm going to write function and then paste the name that we've written. And the parentheses put the columns. So we have defined the function. And inside of here, we need to write the code, change the score on an enemy has left the screen. So we'll need to retrieve the score label so we can write the dollar sign. And here we can find convince layers slash score label. And we'll create a new function inside of this node that will add to the score. So for now let's write dot add underscore score. And this function doesn't exist yet, so we'll need to create it. So let's save this file and we're going to attach a new script to the score label node. So click on the score label and click on Attach script and create. And here we'll create the score function. We also going to create a new variable called score. So the score equals 0, which will store the current score. Below that is read Funk add underscore score, open the parentheses and colon, which has defined a function. And inside of it, we're going to score equals plus one. So every time we call this function, it will add one to the score. Next, we need to update the text that is displayed by our label. We can do that by writing text, which refers to the text property of the label equals STR. And then between parentheses, score, this function converts to score, which is a number into a text, which is necessary if we want to display it inside of this text property of the label. Next we can see it and save the scene and it will run the game. It should be working. Okay, so now that our scoring system is working, we'll add a simple menu to our game instead of simply restarting it when the player dies. 8. Menu: So now we're going to add a simple menu to our game. So to do that, we need to create a new scene. To go back to the Scenes folder, Right-click, click on new scene and name it menu. This is going to be an interface. So we're just going to select user interface for the root node. I rename it to menu and save the scene. First, I want to add a background to our menu. So I want to reuse the tiles that we've created in the word sin. So I'm going to go into the world scene and select the background Sprite. I could just copy and paste it, or I can do a right-click and select Save branch as sin. We'll create a new scene from this node, since we want to reuse it in multiple places, it's a good practice to do that. So click on that and I'm going to save it in the Scenes folder as background that the asean and click on Save, then I save the word sin. And if I go back to the menu scene, now we can just add an instance of the background scene inside of the menu scene. Next, I'm going to add a label to the menu, which will contain the title of our game. So I'm going to rename it to title. And the text is going to be planed. Survival. I'm going to assign the custom fought that we've created inside of their custom fonts property of the label. So enable font and drag the custom font inside the property. I'm going to modify the layout the top wide and align it at the center. Then I'm going to move it to be around here. Then I'll add another node of type button. I'm going to rename it to Start button. And bell, right? Start in the text property of the button. Just like for label, I'm going to assign the custom fought to its font property. I'm going to place it a bit below the title. I'm also going to go inside of the rect category and set the Min size to a 100 on the x-axis and reposition it. So it looks a bit better. I think it's a bit too big compared to the title, so I'm going to click on the title label. And in the fourth property, I'm going to click on the field. We'll open the properties. And here I'm going to modify it a bit. But first I need to right-click on this property and click on make a unit. This way it will create a copy of our first resource that I'll be able to modify only for this label. If I don't do that, if we modify the fourth everywhere, I put it in the game. So now I can change the size. So I'm going to put it as 26 and I'm going to change the outline size 2, 3. Next I can add some sprite in the menu to make it look a bit better. So just drag the sprite directly here. Just make sure it's a child of the menu node and not a child of the title labor law, tomos or not. So I'm going to drag it back to be at the same level as other nodes and I can resize it. If you hold Shift, it will keep the aspect ratio of the sprite and then design the menu however you want. Sure to select the menu root node before adding more sprite. And I'm going to put some enemy sprites. And now we're going to add a script to our menu so that our start button is working. So click on the menu, click on Attach, script and Create. And now we need to connect to a signal that is emitted from the buttons. Click on this button under the node tab, we'll see oppressed signal will connect to this one. So click on Connect 3, the menu node. Click on Connect. It has created a new function where we can respond to the player pressing the start button. So here we'll call the function called get tree to retrieve the symmetry object, present our sin, and that gives us some functionalities. And inside of that object, there is a function called change sin. And we can give it any scene that is in our project. So here when we press the Start button, we want to go to the world over again to select the world sin. If it doesn't appear out the auto-completion didn't work for you. You can just drag the scene that you want inside the parenthesis and it will do the same thing. Now say everything. And in the project setting, we want to change the main scene of our game because before we didn't have a menu, so we just launched the word sin. But now we want to set it as a menu scene to go to project, project setting in the general tab and in the R1 page under the application category, we can change the main scene of our game. Click on the little folder and select the menu scene instead of the words in. Now the menu scene will be launched by default when we press F5 or the Play button. Now in the word sin, instead of restarting the game when the player dies, you want to go back to the menu scene. So in the word script, in the unexposed sound finished function, we're going to replace the real currents in function by sin and select the menu scene. Now we can test it. If we lost the game, went up and down menu, I can click the start button, which will launch the game, can play the game. And when we die, it sends us back to the menu. So now it's looking pretty good. All we have left to do is to add the music. And the highest cost system. 9. Highscore and Music: Now let's go back to our menu scene and we're going to add a new label, select the menu root node, and add a new child node of type label. And I'm going to name this one highest label, which will display your highest score in the Inspector tab, I'm going to write in the text property highest colon 0. I'm going to set the layout to tap wide and center it. Next, I'm going to assign our custom fought in the front property. And I'm going to move it a bit below the Stop button. Now to keep our high score, we need a way to store data that will not be reset when we change scenes. If we add it to a script, every time we change the scene, it will be reset back to 0. There is a way to do that in Gueckedou with something that's called an auto load, which is a script that will not be reset when we change things. So it's a good way to keep global data. In order to do that, we're just going to create a new script. So directly in the res folder, right-click and click New Script. I'm going to name it global dot-dot-dot and click on Create. Now it has created a global digital file. So if we double-click on it, we can modify it. And I'm going to add this script as an auto load. So to do that, I'm going to go in project, project setting, we have a tab called auto load, and I'm going to click on the little folder icon and select the global file. Click on Open and click on Add. So now everything we write in our script will be globally available and will not be reset image. We can keep our high score here. So let's create a new variable called highscore and set it to 0 and save the script. Now let's go back to the world sin. And when the player dies, we're going to store the current score inside of the high score variable. So in the on player died function before everything, we're going to write global, which refers to our new script. Hi score equals. Then we need to get the trans score. So dollar sign and select conversely a slash score label that score. This way every time the player dies, we said the high score as the Quran score. But actually, we only need to do this if the current score is higher than the current high score. So we need to put all of this inside of an if statement. So let's do it and we're going to write if current score, so this value that we retrieved from the score label node is higher than the current high score. So this value then right column, and put a tab that before the next line of code, which means this line is contained inside of this statement. And this will only happen if this condition is true, which means if the current score is higher than the high school and going to save that. And finally, in the menu sin, we want to set the highest label text to be the current high score whenever we arrive on the menu screen. So to do that in the menu script, we can actually add a new function called underscore ready. And just like the endoscope process function, this is a built-in function, and this one will basically be called only once when the scene loads. We can use it to initialize some things. Here we're going to initialize the text of the highest label node to be the current high score. So to do that as retrieved the label, so dollar sign IS label dot text equals and we're going to set the text to directly here. So open the double-quotes and write highest column, then a space, then outside the quotes into red plus and use our function as DR, which converts a number into a text. And inside that function, we're going to give it a global highscore. This way, when we arrive on the menu scene, this will be run directly. Aid will set the text of the highest label to be the current high-school. Let's test it. Let's currently a 0. If I play, my score is currently at six, I die. And then my highest score is now six. If I launch the game again and die directly, tesco is still six. So it's all working perfectly. Now we'll add our background music when we start the game. So go to the word sin, select the world root node, and we're going to add a new child node of type. String player creates, going to rename it to music. And I'm going to drag the big pit loop, not MP3 file inside the string property of this node, going to set the volume to minus 15. And I'm going to say it to autoplay this way when we stop the game, the music will play automatically. Now that our game is basically done, we can export it and publish it on each dot IU. 10. Exporting and Publishing: Now, if we want other people to be able to play our game without having CO2 on their computer, we need to export it. To do that, click on Project export, it will open a new window. Here we can click on add, and here we can select the platform where we want to export our game. We're going to select Windows desktop. And here we'll see an error message is because we don't have an export templates to export our game. So goto doesn't know how to do it. So we need to click on Manage export templates. And here you can see that our X-bar template is missing. So click on Download and just click on the first link and how good it will download the export templates. Just wait until it's finished. If it doesn't work for you, you can also just download the file directly from Dakota website and install it from the file by clicking here, you can download the file in the download page of the website under Export templates. Once it's done, if we go back to the export, page 2, error message should be gone. And now we'll set up a custom icon for him. So if we go down at the bottom of the screen, tells an icon build, we can select a file. I've created one in the assets in packaging folder, which I've called game icon that ICU. If you want to add another icon or create one yourself, you can do that from a PNG file and use an online tool to convert it to a dot ICU. What's important is that you have all of the following sizes in your dot icon file. Else, in some places could do will a default go-to icon instead of your custom icon if you don't give it all of the sizes in needs. Personally, I used an online tool called a convert.com. We also need to go back to the project settings page and in the general tab in the config page, we also have an icon property and the window's native icon property. So we need to set those. So I'm going to select the player ship icon for the icon property and for the window's native icon, I'm going to select the icon file that I've created. And now all of the fields we have changed. We'll change the icon of our game in the windows taskbar and in the title of the window running or game. But if we want to change the icon of the executable file that will be downloaded on our computer, we need to do a few more things. Feel free to skip them if you don't really care about it. If you do, we need to go to this website to download a little app called RCA edit to download the latest release of the app and put it wherever you want on your computer. Then go back to good old, we're going to close the project settings page and go to the editor and the editor settings page. If you find the export category in the Windows page, we have a property named RC edit and we need to give it the path to the RCA did file that we just downloaded to click on the little folder icon and retrieve the path to your RC edit executable file and click on Open. Next we can close this window and go back to the export page. Turn our icons should be working, so we need to set a few less properties before exporting our game. First, the export path. So I'm going to create a new folder called Build. Now I'm going to save it as plain survival. That EXE and save. We can set a company name. So I'm just going to put Blowfish and the product name will be plain survival. The bottom to get there. And finally, click on Export project. And don't forget to antique export with debug 10 Save. And once it's done, you should be able to find your game in the folder that you specified with an EXE file and the PCK file. Now we're going to select the two files, right-click and create a zip file. And we're going to upload it to each that IU. If you go to each data, you will end up on this page. This is a website where basically anyone can upload their energy projects for free and you can put them in for free or even seldom are also a lot of game jumps that are organized there, which are competitions that usually last a couple of days where people make games and submit them and vote on them. So it can be a fun thing to participate in what you know how to make basic games. So first you'll need to create an account. So click on Register at the top right of your screen, select the username and feel the info. Then click on Create Account. Once you've created an account and logged in, you will end up on your Creator dashboard where you'll be able to see all of your project and their stats, like how many views or downloads they have. And here you can press Create New Project to upload your project, or click on the little arrow at the top right of the screen and click on upload new project. Here we're going to set a name. So plain survival, this will assign it a default link which you can change if you want to. You can set a short description. For example, my first game, it's a game so we can leave it classified as again, it will be a downloadable project and we can sell it. Released is fine. We can set the price more game. So you can either accept donations, make it fully paid out, not accept payments, and it's going to pull it up for free. And then here we have to upload your file. So click on Upload File and select the zip file that we've created earlier. Wait for it to finish. While it's uploading, we can set a basic description. We can also set a genre for games. So I'm just going to put action and a few tags if you want to upload is finished, we can take the window box because it's again for Windows and we can upload a cover image. So if you go back to the top, you can click on upload cover image. I've created a thumbnail in the packaging for the assets that you've downloaded earlier. So we can select it and we can also add a screenshot. So in the same folder there's a screenshot. And finally, once this is done, you can choose to allow comments or not and then release it either as a draft, restricted our public. For now, I'm going to save it as a draft. And that's it. It's now uploaded to each on now it's a draft. But if you click on Edit game and go back down all the way, you can just set it to public and anyone will be able to download it and play your game. So click here when you feel ready and congratulations, because you've just released your first game. 11. Outro: Congratulations for getting to the end of the class, we published a fully functional game using only free tools and assets. Along the way, we learned about where we can find three assets for games, the basics of Godot, and how to use since nodes and signals to create a world where the player and enemies or to make a scoring system. How to make a menu screen with Control knows how to create an explosion effect with the particles to denote how to export a game in Brazil and how to publish your game on each dot IU. But we also learn some important details like how to map inputs and GitHub, how to use auto load scripts to make that site globally available in our game, how to tweak import settings or images appear correctly. So that sounds top loop indefinitely. How to add just unfolds for games and how to set up the icon for games. Help making this little project was helpful to you and that it gives you the confidence to delve deeper into the world of game development is you want to learn more about programming, game development. And kudzu, feel free to follow me here on Skillshare and on my website at Blockbuster. Did you find the link on my profile? Thanks for watching and I'll see you next time.