Prismo
What goes into creating a 2-D plaformer?
Online Games
Last year, I decided to try something I had wanted to do since I was little, create a video game. I made a simple top-down shooter and wrote a blog post about it. That was really fun, but it didn't quite meet my hopes for two reasons:
- The game wasn't a 2-D platformer, which was my favorite type of game as a kid.
- The game was hard for people to play, it had to be downloaded.
Thankfully, these issues are pretty easy to fix. I just needed to make a 2-D platformer that can be played online. Of course, that's easier said than done. Since I'm already familiar with Unity from the last game I built, I decided to use it for this too. In January, I set a goal to publish the game before the end of the year, and I've been working on evenings and weekends for a long time. I'm finally to a point where I can share a rough draft.
Visuals
The aesthetic of this game was inspired by old pre-color games like Pong. I made a little cube for the player, and animated him blinking and bouncing so he looked more alive. I also added a slight squash animation when he jumps to make him look bouncier. I added particles to the jumps and wall slides to try and sell the movement. Since I'm a big fan of Unity's shadow features, I gave the player a little light that casts shadows on the environment. Because of the light, I decided to name the protagonist Prismo.
Movement
Player movement is by far the most important aspect of any 2-D platformer. Imprecise control causes a very frustrating player experience. Whether these controls are floaty or have too much momentum, inadequate control destroys the player experience.
To fix this problem, I had to manually code the movement instead of using Unity's built-in physics system. While this was a huge hassle, it let me add in a bunch of optimizations to the player experience.
Movement Optimizations
So what optimizations did I end up adding? Normally, the player can only jump while on the ground. One optimization called Coyote Time tweaks this rule. It is named after Roadrunner and Coyote, where Coyote would stand in the air and not fall until he looked down. With Coyote time, the player has a little bit of time after leaving the ground that they can still jump.
I made a few more optimizations to help with player experience. One was differential jump height. If the player holds the jump button for longer, we want the player to jump higher. This improves the feeling of control. To further improve the control, we bend the "only jump while on the ground" rule again. If the player hits the jump button for a few milliseconds before touching the ground, they jump as soon as they hit the ground. I also added a wall jump feature, which was a real bear to program using my custom physics. I wrestled with that for several months before getting it down.
Music
With the visual aesthetic and the mechanics of the game down, it was time to add another integral part, music. I composed my own chiptunes for Chrono Chaos, and that was a ton of work. While working on the chiptunes, I noticed they had a lot in common with Baroque music. They are usually only a few (3-5) parts because of hardware requirements. Old audio chips like in the NES only had a few channels. Baroque music is good background music. It is nice to listen to, but not distracting.
Inspired by the old saying, "Good artists borrow but great artists steal", I started with some old concerti by Charles Avison, an 18th-century composer. One of Avison's famous works wasn't even written by himself, but was an arrangement of some of Domenico Scarlatti's works. I decided to take the story one more level by arranging and reinstrumenting a few of Avison's reinstrumented arrangements of Scarlatti's works, giving them a distinct video game feel.
Conclusion
This game is really starting to come together. It looks nice, and the player movement works great and feels smooth. I've also coded up a bunch of boring but necessary aspects like a pause menu, volume controls. You can try the tutorial right now in your web browser (on a pc) right here.
I'll have a part 2 post about level design along with the full game by the end of 2024.