Making a small platformer to learn more about video games - part 2


Second day of this journey. I think starting tomorrow I will tone down a little bit on this project since the big Carnaval holiday is ending, and I need to focus on other stuff, but I will try my best to work on it. I also believe this one will end soon since the idea is to make a small platformer game, and it's already very much playable. I still want to polish a thing or two, to be more presentable, as well as learn more about some stuff.

Godot 4.4

I updated to Godot 4.4. I know I could stick with 4.3 until the end of this project, but since I started yesterday, why not? I had a bit of a headache with the UID, but I could hide them on the editor (I use VS Code as an external editor). I will also blame on this files on my bad decision to make a huge commit instead of small ones for each activity, but it's all fine now.


Git

A small alert if I ever open the source code for this project. Sorry about the huge first 2 commits, first I just wanted to make as much as I could before creating a git for this project, and the second was the UID files, I thought I was losing time with problems switching between 4.3 and 4.4 and I just started tackling things up. I later started making commits for each feature I was doing (or a few features per commit), all in the main branch (also sorry, but since it's a small project I don't see the necessity of making various branches, at least right now).

Enemies

I started my day watching DevWorm's video about creating enemies on Godot 4. I was on the right path I think, I just had to change the root node of the enemy to be a CharacterBody2D and keep the multiple Area2D inside it. This way, making the enemy movement was easy. I just had to make it choose a direction and change it when colliding, the rest is pretty much the same code for the player. Also, when the player dies, stop the animation and movement of all enemies in the level.

The biggest problem thought was that I had a problem with the class_name declaration, so I had to use the node names (which are strings) to detect which body is colliding with the enemies. Every time I declared the class_name for both player and enemy, Godot would argue saying it couldn't find the resource files, forcing me to remove the declaration and restart the editor. I'm not a fan of using the nodes' names, but I will check about that later.

Level

For the levels, I easily found a way to make scenes as collections in a TileSet, this way I removed all those nodes from the level and could place them in whatever I want, like tiles in a atlas/tiled image. In this case, I made the enemy, the coins, and the player as part of the TileSet. Building a level became easy.

I still need to learn more about TileMaps in Godot, they seem to be very powerful and kinda easy to use in some scenarios. I wonder how it will work when handling a big scenario, like in a Metroidvania.

I also redesign the level, looking more like a real video game one. Still very short though.

Audio

For the audio, I thought about creating a manager scene for it and found a video by the Aarimous channel that I think was really good about the topic.

But instead of creating resources for the audio files and managing in a globally loaded scene, I decided to take a simpler and faster approach (and using the excuse of the game being small). I made a scene where I include all the files I want (for now, only one), and connect with an event that will receive a name (which is a string) inside it and match with the sound case you want to play. The manager will be part of the main game scene that manages everything. I know this approach is not good for some reasons, every time I add a new sound I need to code a matching case in the script and make sure there is a reference to it, if I delete a sound I also need to manage everything to not play an undefined reference, strings are not good if you might change names in the future, and so on, but since it's a small project, I will let it this way.


This made me think about creating an audio management focused module/game to learn more about audio stream, management of audio files, and other parts of this field in Godot. If this ever goes into fruition it will be here sometime in the future.

UI

For the UI, I did a simple big text that will appear when you win or die. I also added the buttons for restart and quit (on desktop versions), and a score counter. Nothing sophisticated, only to show the info and help to understand what happened when playing.

Background

At the end of the day, I decided to tackle the backgrounds of the game and experiment a bit with the parallax node. Did a few super simple images and there is that, but I still need to read more about it to understand and fine-tune the movements.


For now, version 2 is more polished, but there still room for improvement. Next, I will try to tackle:

- The problem with class_names. I will try to understand it and see what I can do.
- Study a bit more about the tilemaps and the backgrounds.
- Maybe an extra in including more sounds, making a title screen, and even another level. Let's see.


With all that, I conclude today's devlog for this small project. See you later with another update soon o/

Files

web.zip Play in browser
53 days ago
small-platformer-version-2.x86_64 66 MB
53 days ago
small-platformer-version-2.exe 93 MB
53 days ago

Get small platformer

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.