Course Requirements: Godot 4 Mini-Projects
Course Requirements: Godot 4 Mini-Projects
Course Requirements: Godot 4 Mini-Projects
Introduction
In this course, we will be expanding our knowledge on the Godot Game Engine by looking at different
aspects of the engine that will help us create our games. We will be doing this by creating four mini-
projects, each of which will cover a certain Godot feature or collection of features.
Course Requirements
In order to get the most out of this course, there are some requirements:
Mini Projects
The first mini project we will be creating is a balloon popper minigame. This will work by clicking on
the spheres, which will grow in size, and when they reach a certain threshold, they will pop and give
us some score. We will be looking at a number of systems with the balloon popper minigame, such
as detecting clicks on objects, setting up a scoring script, as well as having some text on screen that
is going to display a current score.
We will then move on to look at physics inside of the engine. We will explore what a rigid body is and
all the different properties that we can modify in order to get the physics that we want for our game.
We will put this to use by creating a mini game where you can click to throw around a player and
crash into a bunch of crates.
We will then be looking at more of a coding side system, and that is the idea of loops. Loops are a
very important part of programming and coding in general, and especially in game development,
where you want to have one sort of action be repeated many times without having to rewrite the
code. We will be using this to create a randomly generated star system, where each of the stars
have a random position and size.
Finally, we are going to be looking at collision inside of Gau and Engine. This will be done by
connecting up a signal to our player. A signal is an event when something occurs, for example, our
player hitting into a tree. When this happens, we are resetting the scene. Collision detection is
something that is going to happen in many games and is definitely something that you do need to
get used to when working with the Goudeau engine.
Zen NVA is an online learning academy with over 1 million students. We feature a wide range of
courses for people who just starting out, or for people who just wanna learn something new. The
courses are also very versatile, allowing you to learn in really whatever way you want. You can
choose to view the online video tutorials, read the included lesson summaries, or follow along with
the instructor, the included course files.
Godot 4.0
This course was made using version 4.0 of the Godot engine. If you are encountering any issues with
the course material, that may be due to your version of the engine. Many of the features explored in
this course are different or missing from previous Godot versions and may also be different in future
versions.
Creating a mini-game in GDO can be a great way to learn the basics of game development. In this
lesson, we will be creating a balloon popper mini-game. This game will feature a number of different
balloons on the screen that can be clicked on to increase their size. Once they reach a certain size,
they will pop. Along with this, we will also have a scoring system that will be displayed on screen
using UI text.
The first step is to create a root node. This node will contain all other nodes and will be the origin of
the game. To do this, we will go to the GDO project manager and create a new project. We will give it
a name, such as GAU Mini Projects, and save it to our documents. Then, we will open the project in
the GDO editor. Here, we will create the root node by clicking on 3D scene and renaming it to
“Main”. We will then save the scene in a folder called “Balloon Popper”.
Next, we will create the balloon that will be clicked on. To do this, we will add a new node of type
“Area 3D”. This node will be able to detect collisions and physics interactions. We will rename it to
“Balloon” and attach two child nodes to it: a mesh instance 3D and a collision shape 3D. The mesh
instance 3D will be set to a sphere mesh, and the collision shape 3D will be set to a sphere shape
3D. This will create the balloon that we can click on.
To view the balloon, we will need to add a camera and lighting. We will add a Camera 3D and set the
“Current” property to “On”. We will also add a Directional Light 3D and aim it at the sphere from the
front. This will create the lighting that we need to see the balloon.
Before the next lesson, we should experiment with the camera and create a material for the sphere.
We can change the camera’s field of view and position, and create a material for the sphere that has
a nice, bright color and a shiny surface. This will make the balloon look more realistic.
In this lesson, we learned how to create a material for our balloon and how to detect mouse clicks on
the balloon. We also discussed how to increase the size of the balloon and set up a scoring system.
To create a material for the balloon, we right-clicked on the balloon folder in the file system, went to
‘New Resource’ and searched for a ‘Standard Material 3D’. We then clicked ‘Create’ and named it
‘Balloon’. We then clicked and dragged the material onto the balloon mesh. We then selected the
material and went into the inspector. We changed the color to a vibrant red and adjusted the
roughness and rim to make the highlights around the edges pop. After pressing play, we saw what
our balloon would look like.
To detect mouse clicks on the balloon, we connected to the ‘Input Event’ signal in the Node panel.
We then created a function and checked to make sure that the event was a mouse button click. We
then checked to make sure that the mouse button was the left button and that it was only called
when the mouse button was pressed down. We tested this by printing out a message when the
mouse button was clicked.
We created three variables: ‘clicks to pop’, ‘size increase’ and ‘score to give’. ‘Clicks to pop’ is how
many times we have to click on the balloon in order for it to pop. ‘Size increase’ is how much we
increase the balloon’s scale by every time we click on it. ‘Score to give’ is how much score we give
once the balloon gets popped. We will learn how to increase the size of the balloon and set up a
scoring system in the next lesson.
In this lesson, we are continuing to work on our balloon popper mini game. We have already set it up
so that when we click on the balloon, it prints a message. Now, we are going to make it so that when
we click on the balloon, it increases in size and eventually pops.
This adds 0.2 to the x, y, and z axis, making the balloon increase in size. We also subtract clicks to
pop by one every time we click, and check if clicks to pop is equal to zero. If it is, we increase our
score and destroy the balloon.
To keep track of our score, we create a new script called Balloon Manager. This script has a variable
called score, which is set to zero by default. We also create a custom function called increase score,
which takes an amount parameter. This function adds the amount to the score. We then call this
function from our balloon script, before we destroy the balloon.
We can now duplicate the balloon and have multiple balloons popping. We can keep track of our
score in the output, but in the next lesson, we will look at how to display the score on the screen.
In this lesson, we are going to finish off our balloon popper mini-project by setting up different values
for each of our balloons. This will allow us to have one balloon require more clicks than the others,
for example. To do this, we need to add the keyword export before the variable definition in our
balloon script. This will make the variable available in the inspector, where we can change the value
of the variable for each instance of the balloon. We can also add the export keyword to each of our
other variables.
We also need to set up some UI text to display our current score. To do this, we create a new node
called label, which is a control node (green). We can move the node around and resize it using the
orange box with dots around the outside. We can also type text into the inspector, which will appear
on the screen. We can increase the font size in the label settings. We then rename the node to
scoretext and connect it to our score in the balloon manager script. This will allow us to display the
score on the screen.
Conclusion
This is a basic look at the UI system inside of Gado. There are many other things you can do with
buttons, labels, input fields, dropdown menus, and more. Experiment and have fun!
In this lesson, we looked at how to set up a physics project in Goudeau. We started by creating a
new scene and saving it to a folder called “physics”. We then added a Rigid Body 2D node, which we
renamed to “player”. We also added a Sprite node, which we renamed to “Sprite”, and set its
position to (0, 0). We then changed the default texture filter from linear to nearest, to make the
Sprite less blurry. Finally, we added a Collision Shape 2D node, which we set to a rectangular shape
and resized it to fit the bounds of the Sprite.
We then tested our Rigid Body 2D by adding a Camera 2D node and setting the zoom to 2. When we
pressed play, we saw that the Rigid Body 2D was affected by gravity and fell down. We then created
a script called “Physics Player”, which we attached to the Rigid Body 2D. This script detects when
the left mouse button is pressed, and applies an impulse in the direction of the mouse cursor. We
also added a variable called “hit force”, which is the amount of force applied when the mouse button
is pressed. Finally, we added a linear damp to the Rigid Body 2D, to slow it down over time.
In the next lesson, we will be adding crates to the scene, which will also be physics objects. We will
also be finishing off the project.
Introduction
In this article, we will be discussing how to create a physics project in the game engine, Godot. We
will be looking at how to create a crate, add a collision shape, and adjust the gravity and drag. This
article is aimed at beginners, so we will be taking a step-by-step approach.
Creating a Crate
The first step is to create a new node of type RigidBody2D. We can then rename it to “crate” and
add a Sprite node as a child. We can set the position of the Sprite to (0, 0) and move the crate to the
desired location.
Next, we need to add a CollisionShape2D node. We can set the shape to be rectangular and adjust
the bounds to fit the crate.
Now we can press play and test the crate. We need to make sure that the crate does not fall to the
ground, so we can set the gravity scale to 0. We can also add some drag to the crate by setting the
linear damp to 3.
Finally, we can save the crate as a scene and duplicate it to create multiple crates. We can then
press play and move around the crates, which will interact with each other.
Conclusion
In this article, we have discussed how to create a physics project in Godot. We have looked at how to
create a crate, add a collision shape, adjust the gravity and drag, and create multiple crates. We
have also discussed how physics can be used in different game types.
What is a Loop?
A loop is a piece of code that is used to run a certain set of instructions multiple times. It is useful for
when you need to repeat a certain task or action multiple times, such as printing a message or
spawning enemies in a game.
Creating a Loop
To create a loop, you need to use the for keyword. This is followed by a temporary variable, which is
used to keep track of the number of iterations of the loop. You then specify the number of times you
want the loop to run, and then write the code that you want to be repeated. For example, to print the
word “hello” 10 times, you would write:
for i in range(10):
print("hello")
Loops are incredibly useful for game development. For example, you can use a loop to spawn
multiple enemies at once, rather than having to specify each one individually. You can also use loops
to generate random elements in your game, such as randomly positioning stars in a star system.
Conclusion
Loops are an essential part of programming, and are incredibly useful for game development. They
allow you to repeat a certain set of instructions multiple times, and can be used to generate random
elements in your game.
In this lesson, we are going to create a star system in a 2D viewport. To begin, we are given a
challenge to create a variable called score, which increases by five 10 times and then print out the
results. To do this, we create a variable called score and set it to zero. We then create a for loop
which will loop 10 times and increase the score by five each time. At the end, we print out the result
which should be 50.
Spawning Stars
We then move on to spawning stars. We create a variable called spawn count and set it to 200. We
also create a variable called star scene which is equal to preload and give it the path to the star
scene. Inside the ready function, we create a for loop which will loop the amount of times specified in
the spawn count variable. We then instantiate the star scene and add it to the scene tree.
We then give the star a random position. To do this, we need to know the bounds of our
environment. We drag in the star scene and open up the transform to see its position. We then set a
random position between negative 280 and positive 280 on the x axis and between negative 150
and positive 150 on the y axis. We also create a variable called star size which is equal to a random
float between 0.5 and 1. We then set the scale of the star to this variable.
Conclusion
By using random generation, we can quickly and easily create a star system with a variety of stars.
We can modify the spawn count variable to change the amount of stars spawned in. We can also
modify the environment settings to change the background color.
In this lesson, we are going to explore collision interactions by creating a skiing game. We will be
using a static body 3D node to create our ski slope, and a rigid body 3D node to create our player.
This article will explain how to set up the environment for the game.
First, we need to create a new scene. Go to Scene > New Scene, and select 3D Scene. Rename the
root node to “main node”, and save the scene inside a folder called “collision” as “collision.tcn”.
Next, we need to create a static body 3D node. This will be our ground. Right click on the ground
node and add a child node, a mesh instance 3D. Select a cube as the mesh, and then add a collision
shape 3D. Change the shape to a box shape, and make sure it fits the bounds of the cube.
We then need to change the size of the cube. Select the static body parent, and press R to go to the
scale tool. Scale the cube on the X axis to 12, the Y axis to 0.3, and the Z axis to 30. Then press E to
go to the rotate tool, and rotate the cube around -20 on both the X and Y axes.
We now need to create our player. Create a new node of type rigid body 3D, and then add a mesh
instance 3D. Select a box mesh, and move it up a bit so it’s easier to see. Give it a color by going to
the inspector, and selecting a surface material override. Create a new standard material 3D, and
modify it to your liking.
You can now go ahead and create your player character. Resize, scale, and duplicate the cubes, and
move them around. You can also give them different materials. Once you are done, you will have a
player character ready for your skiing game.
In this lesson, we will be setting up our character’s movement and environment in the game engine
Godot. We will be creating a 3D character with a collision shape, a camera, and a directional light.
We will also be creating a WorldEnvironment node to change the background color, ambient light,
and fog.
First, we will create a 3D character with a collision shape. To do this, we will right-click on the
RigidBody3D node and add a child node of type CollisionShape3D. We will then fit the box shape to
the bounds of our player. Next, we will add a Camera3D node as a child node of the RigidBody3D
node. We will then position and orientate the camera to look at our player. We will also enable the
current property in the inspector.
We will then create a DirectionalLight3D node to provide lighting in our scene. We will position the
light to shine down on an angle. We will then go to the Shadow property in the inspector and enable
it so that our player has a shadow. We will then create a WorldEnvironment node to change the
background color, ambient light, and fog. We will select the WorldEnvironment node and create a
new Environment property in the inspector. We will then change the mode from ClearColor to
CustomColor and give it a nice blue. We can then press play and it will look more like a skiing level.
We will then select our player and create a script called PlayerMovement that inherits from
RigidBody3D. We will delete the ready and process functions and create a variable called
moveSpeed of type float. We will set this to two and export it so that we can modify it in the
inspector later. We will then create a function called _physics_process which will detect our key
presses. We will then set our linear velocity on the x axis to be negative or positive move speed
depending on whether the left or right arrow key is pressed. We will then press play and we should
be able to move left and right as we ski down the hill.
In this lesson, we have set up our character’s movement and environment in the game engine
Godot. We have created a 3D character with a collision shape, a camera, and a directional light. We
have also created a WorldEnvironment node to change the background color, ambient light, and fog.
We have then created a script called PlayerMovement that detects our key presses and sets our
linear velocity on the x axis to be negative or positive move speed. We can then press play and we
should be able to move left and right as we ski down the hill.
In this video, we learned how to create a tree obstacle in a 3D game. This obstacle can be used to
create a mini game, where the player has to avoid the trees while skiing down a slope.
The first step is to create a new node, which we will call “tree”. We then add a mesh instance 3D,
which will be a cylinder mesh. We can resize it and give it a material, such as a brown color. We can
also add multiple mesh instances to create a more detailed tree model.
Adding a Collider
We then add a collision shape 3D to our tree. This will be a cylinder shape, which we can fit to the
bounds of our tree trunk.
Adding a Group
We then add a group to our tree node, which we will call “tree”. This will allow us to differentiate the
tree from the ground, so that we can detect when the player has collided with a tree.
Detecting Collisions
We then select our player rigid body and go to the signals tab. We then connect the body_entered
signal to the on_body_entered function in our player movement script. Inside this function, we check
to see if the body that we have collided with is a tree. If so, we then reload the scene.
We then need to enable contact monitoring on our player node. This will allow us to detect contacts
with other colliders. We also set the max contacts reported to a number higher than one, such as
three.
Conclusion
By following the steps outlined in this video, we can create a tree obstacle in a 3D game. We can
then detect when the player has collided with the tree and reload the scene. This is the basis of
creating a mini game, where the player has to avoid the trees while skiing down a slope.
Introduction
In this course, we have explored the Gau engine and created four mini projects. We have looked at a
balloon Papa mini game, a physics game, loops and collision detection. In this article, we will discuss
the concepts and techniques used in each of these projects.
In this project, we used the input function to detect clicks. We then checked to see if the mouse
cursor was over the balloon, and if it was being pressed. When this happened, we increased the
balloon size. When it reached a certain size, it popped and increased our score. We then used a label
to render the score on screen.
Physics Game
We explored Guido’s physics system and looked at the rigid body node and its properties. We
applied an impulse to the player in the direction of the mouse cursor. This gave us a basic look at
Guido’s physics system and the principles that apply to 3D as well.
Loops
We used loops to generate a randomly generated star system. This gave each star a unique position
and size. Every time you play, it will be totally different and you can control how many stars you
want to spawn.
Collision Detection
We set up a ski mini game where the player is skiing down a hill and when they hit a tree, the scene
gets reset. We connected the body entered signal to our player and checked to see if the body that
we hit was in the group of tree. Groups are very handy when it comes to collision detection. For
example, if you were to have a first person shooter game and you wanted to check if your bullet hit
something, you could check to see if it was in the group of player.
Conclusion
This course has given us a great introduction to the Gau engine and the concepts and techniques
used in game development. We have explored the input function, Guido’s physics system, loops and
collision detection. We hope this article has been helpful in understanding these concepts and
techniques.