My first platformer - The story so far.
Hey guys!
I'm finally getting to work on my first game. Just figuring ways out to hold myself accountable and keep people posted.
I've started to work on a platformer in Game Maker. The assets I've used are taken from itch.io game assets. I want to start off by thanking Thor @PirateSoftware for the push he gave me to start on this project. Even though your words were not directly pointed towards me, I started this journey because of the motivational speeches you are putting out into the world. My thankfulness is beyond immense as I have garnered newfound knowledge and a sensation of calmness throughout this process. Yes, somehow game dev has been very calming for my mind as a Software Engineer. It's different, it's new, it's instant gratification. Shaun Spalding (ShaunJS), your tutorials have set the foundation of my games. Hibico, if you're reading this, thank you for constantly encouraging me to learn more by pushing me towards the next hurdle/challenge after taking the time to look at my current one. Tuck, Tucker, your kindness cannot be missed. Cutting off the conversation for people to look at my progress was embarassing, but also heartwarming and wholesome. Thank you.
I sort of knew what I wanted in my game, mechanically.
- Idling
- Running
- Jumping
- Double jumping
- Wall hanging
- Wall jumping
- Attacking
- Attack combos
- Air combo
- Floor combo
- Attack effects/projectiles
My first hurdle was, as a streamer I watch likes to call it, "The Hello World of game dev"; Movement. So I went to work on the first set of movement mechanics. I created a small level, and managed to get a parallax effect on it set up. I made each block its own object even though the tileset asset I purchased had a tilemap in it that I could have just used as well.
So, as you can see, the movement was working, and I got a basic wall hang working. At this point, my collision effect was off. I realized that this happened because the collision map of the player object was changing with each sprite. This meant that if for example, the "air roll" animation was smaller than the hang sprite, it would switch to the hang, get stuck, and switch to a "moving" animation whilst being stuck in the wall. You can see this happen in the following image.
A similar funnier problem happened when I added the double jump animation. I had a good laugh at this one. Seems like I accidentally implemented a snow dive.
I eventually solved this by having the object only use the collision map of one specific sprite, the idle sprite. This was the outcome. I did not have wall jumps working yet as they'd go up vertically still. This was because of the lack of a jump buffer, so I was always moving into the wall as I was holding down that button. My eventual goal was for wall jumps to be jumps off of the wall instead of climbing up the wall.
At this point I had an idle animation, a jump, a double jump, and a wall hang along with improved collisions. So I thought I'd handle wall jumps next. Thanks to ShaunJS's wall jump tutorial from like 10 years ago, I was able to get this done eventually. At least, the first iteration of it.
As you can see, walljumping worked but stayed in the "hanging" animation. I wanted to fix this, but I realized My player state code was getting so hard to manage because of all the ifs and buts that had to go into each state (moving, idling, etc.). I asked around and figured it was time to look into state machines. I refactored all my player state code to use Snow State. The result was much cleaner player object code, and the ability to implement a Finite State Machine that allows me to easily set state transitions and the conditions thereof. I even got to implement the first attack correctly using this technique!
Because Shaun's tutorial taught me about the dust particles you may have seen in the above image, I thought I'd try my hand at adding jump, double jump, and landing effects. I managed to, but they ended up getting spawned differently based on what direction my character was facing. I'll fix that later on.
I had a bunch of problems with my attack too. The attack was.. Constant on an LMB press. Oops.
I managed to fix this by checking for the mouse-down event rather than just looking for a "pressed" event. Attacks also now start a buffer, so that movement is halted during attacks. It shows a bit of overall movement progress too!
Using the Finite State Machine of Snow State, I was then able to expand this to the first full combo.
So yeah, after I fixed this, my brain went back to the problem at hand.
The problem ended up being that I was looking for the bounding box of the character. Hibico was kind enough to point me in the right direction, and I changed it to use the x and y of the object based on the origin point. The origin point of the dust effects were also not set to the middle of the sprite and were still top left. After addressing both issues, it was fixed. Hibico then challenged me to try and support sloped floors. I ended up using move_and_collide() for this, a built-in function that helps you sort out these collision issues.
I'll end this off with some final work-in-progress images. If you have gotten to this point, thank you so much for taking the time to read this!
Rizky's Platformer
My first game, and it's a platformer!
More posts
- KNOCK UPS?!Dec 27, 2023
- We've got dashing.Dec 26, 2023
- First prototype is up!Dec 26, 2023
- Rizky's Nameless Platformer - Health!Dec 23, 2023
Leave a comment
Log in with itch.io to leave a comment.