Postmortem: 2D Platformer As Programming Exercise Project


Motivation

Gravity Dungeon was a programming exercise project. I noticed that many beginner Unity tutorials use a 2D platformer as practice material — probably because making one lets you learn a wide range of essential game development modules. I haven’t played many 2D platformers myself, so I didn’t plan to make the game complicated, but I still wanted to add some interesting mechanics.

For some reason, I recalled the battle-room scenes in Ender’s Game, where Ender fights in a simulated zero-gravity space with no clear distinction between sky and ground. That inspired me to consider a mechanic where the direction of gravity shifts and the entire map rotates, creating fun new challenges for the player. But after realizing how difficult that would be to implement, I adjusted the idea into a more feasible version: allowing the player to change the direction of gravity applied to their own character.

Gameplay

In terms of level design, my intention was to make the gravity-shifting mechanic a powerful and essential aid for players — something that, when used properly, allows them to clear certain obstacles with ease, while other traps would be impossible to pass through using jumping alone. At the same time, it should act as a double-edged sword: misuse can cost HP or even lead to death. Following this guiding principle, I designed the later levels accordingly.

I also wanted the progression of levels to have a certain “rhythm,” similar to Super Mario — where players first encounter simple challenges, and the difficulty gradually scales up. Later challenges shouldn’t feel entirely unfamiliar; instead, they should build on mechanisms the player has already learned, combining or upgrading them to create new obstacles.

Prototyping

I divided the game’s core functionality into three modules: character movement, gravity shifting, and trap mechanisms. The early prototyping focused on these three components.

Character movement and gravity shifting are actually coupled. At first, I thought many adjustments would need to be done manually, but later I found that Unity already provides a built-in method to change the scene’s gravity direction. This made implementing the mechanic surprisingly easy.

For the traps, I first created a few basic components and tested their functions. Then, by combining these elements and pairing them with different terrain shapes, I built various challenges.

Development Procedure

The development process went much more smoothly than I expected. I thought the gravity-shifting mechanic would present many difficulties, but Unity’s built-in functions solved the problem effortlessly. Since each functional module was fairly independent, testing and integration were also straightforward. In fact, most of my time was spent designing and assembling the levels.

Lessons Learned

  1. Implementing 2D character movement, animation, and state machines

  2. Hit-feedback design, including brief invincibility windows

  3. Updating UI elements in response to character state parameters

  4. Progressive level complexity upgrading

Leave a comment

Log in with itch.io to leave a comment.