Video version of Post: https://youtu.be/pNVcad7fpEY
Hi ya’ll, this is my second Getting Started with Godot video. Like the first, it’s mostly tutorials. I’ve done them all under the same project so I can switch between them with this game collocation menu. I’ve also added a sandbox of me doing my own thing.
Dodge the creeps: https://docs.godotengine.org/en/3.1/getting_started/step_by_step/your_first_game.html
This tutorial is direct from Godot. This one taught me about using a navigation path as a spawn ring around the game border.
Here's the little Gathering Game demo from Chris’ Tutorial that I talked about in length last time. https://www.youtube.com/watch?v=nQluyQ-1wSI&list=PL19FbkLnqUDiT9-aBYiauxviYSxh9FQDx
Next we have a match-three game from Peanuts-Code.
https://www.peanuts-code.com/en/tutorials/gd0012_match3/
I’m glad this wasn’t my first Godot tutorial. So far it’s been the most script-heavy one, whereas the other builds rely more on component interaction. Half the code is spent managing and checking the nested array that is storing the pieces' data while the other half manages the display of the pieces on the grid. I felt really fortunate that I’d had previous experience with similar concepts from CodInGames.com. Like most written tutorials, Peanuts-Code provides the script for you. This was written for an older version of Godot, so I needed a few modifications as I went along. This tutorial was really good for showing me ways to process mouse clicks and interactions. The star effect that you see when I make a match barrows from the particle effects that I learned in the Gatherer Game tutorial
Now, Raptor Run. This one is from Quiver.
https://quiver.dev/tutorials/create-your-first-godot-4-game/
Out of the tutorials I’ve done, I’ve made the most changes to this one. One of the visible changes is that the screen shows a high and current score. Also, I made the background Parallax scroll to give the illusion of depth. I added a new bad guy - Mr Angry Happy King, he’ll be a recurring character. I’ve also added a thump when the character lands so that the player can tell when their jumps are reset. Also it’s player feedback. Players love feedback.
I wanna call out an optimization I did on the back-end. First the problem: as an infinite scroller, the platforms are spawning on the right side and moving to the left side. Originally, a timer would trigger the next platform spawning to the far right, and after passing through the visible game space, the platforms would keep going leftwards, forever. These platforms exist even if the player can’t see them, and is never going to see them again, which means they take up memory even when I don’t need them. It’s Not good.
So here are my solutions.
Instead of new platforms spawning based on a timer, the next platform is triggered by the character moving through the teal area2D. The problem of the exited platforms is solved with the red VisibleOnScreenNotifier2D. Once it is no longer visible, the platform scene calls queuefree().
This keeps platform generation and destruction locked to player progress, keeping memory used light and consistent.
So, that brings us to the 2D Shooter from KidsCanCode.org.
https://kidscancode.org/godot_recipes/4.x/games/first_2d/index.html
This game me more practice with detecting when collisions and making sure the collision layering was correct. It’s… listen. Collision layering was the bain of my existence. Could I have left everything on layer 1 and moved on? Sure. Did I want layers for player and enemy ships along with player and enemy bullets? Absolutely. This has caused me no lack of heartache not only here, but in the tower device and raptor tun, and I am sure this pain will continue, but increasing my skill with this mechanic is worth it. I’m sure it is. This tutorial introduced me to clamping to keep the player within the window bounds. Also, the original tutorial has the game taking up the full screen, and here I have several versions of the game on the same screen. This required an interesting number of changes to the code. It was a good exercise that I highly recommend.
TEXT EDITOR -
https://www.youtube.com/watch?v=nk0YQGb08IA
okay, so not a game, but still a good exercise that let me play around with file controls. Games can have a lot going on. Sometimes, it's worth stopping and making a different app for some alternate experience and get a feel for what else the engine can do. This tutorial is on YouTube from Emi. It’s four years old, so some parts needed research to update to the current version.
Here we the good old tower device foundation from Godotneers. I’ve been playing around with Aseprite, and one of my first things was to redo my boat animation. Look at that little guy rock back and forth. Just swaying on the breeze.
Alright, enough of that.
That brings us to the unicorn. This is a sandbox of me putting all these lessons into practice and figuring out some mechanics of my own. The initial jist is a Frogger game - obstacles spawn and move across the screen for the unicorn to avoid. These hearts work as a checkpoint that the unicorn jumps to after taking damage. The doors play opening and closing animations based on an area trigger and load the associated level when you enter them.
My focus in the unicorn sandbox has been to practice re-usability, so I’ve used exported variables heavily in elements like my mob spawners and doors.
Looking at the spawner, I can tweak the settings of each one, controlling mob frequency, type, and movement. For my doors, I can enter file path for the scene that entering the door will trigger to load. A feature I wanted for my locked doors is that the lock and the key are the same color so the player can tell which key triggers which door. The exported color picker lets me set that property very quickly in the UI and the ready script uses that to modulate both items once the game loads.
So, to wrap up, the most recent round of tutorials was considerably easier than the tutorials started with, and that worked really well for me. By jumping in with the more in-depth tutorials I broad foundation, and then the little tutorials let me learn about niche solutions and strategies. Their small size and quick turnaround also let me experiment with lessons learned in other places, or come back and tweak things as I learn new ways to do it.
Godot Docs. Your First Game. https://docs.godotengine.org/en/3.1/getting_started/step_by_step/your_first_game.html
Chris’ Tutorials. (2023, May 23). Crash Course ~ How to Make a Resource Gathering Game in Godot 4! https://www.youtube.com/watch?v=nQluyQ-1wSI&list=PL19FbkLnqUDiT9-aBYiauxviYSxh9FQDx
Peanuts Code (2022, July 2). Match 3 Puzzle Game in Godot3. https://www.peanuts-code.com/en/tutorials/gd0012_match3/
Quiver. Create Your First Godot 4 Game. https://quiver.dev/tutorials/create-your-first-godot-4-game/
KidsCanCode. Your First 2D Game https://kidscancode.org/godot_recipes/4.x/games/first_2d/index.html
Emi. (2019, Jan 27). Making Programs With Godot - Text Editor - Part 1 https://www.youtube.com/watch?v=nk0YQGb08IA
Special mention: CodInGame: https://www.codingame.com/home for being a great platform to practice coding in a wide variety of languages.