Back
2D Platformer - September 2021
This module introduced us to the javascript library p5.js, and the students were set out to design a 2D side scrolling platformer. Getting the bare pieces of code down for character movement and side scrolling, I knew that I wanted to get this game to look as polished as possible (despite not using a game engine). The project requirement felt more of a demonstration of constructor classes for platforms, collectibles and enemies and less of a game. My love of game development shined through this project, and all my efforts were rewarded by scoring 98% in the module overall.
The very first coding project I undertook just happened to be a video game. It contains the most unreadable, inefficient code I’ve probably written to date, yet it’s arguably my favorite. The mentality I had during this project is something I wish to carry forward. It wasn’t about being efficient; it was about making a game. As I’ve grown as a programmer, I’ve become hyper-fixated on being elegant with my solutions, which has sometimes overcomplicated problems and caused me to spend way too much time on trivial issues. This version of myself didn’t even know what efficiency was; I wanted power-ups and used the first method that came to mind to get it done. And hey, it led to a game where I added every single feature I wanted to add, and it all works. At the end of the day, the code served its purpose well, and that’s what matters in the grand scheme of things.
- Implemented custom gravity using velocity and acceleration for variable speed.
- Created multiple systems such as collision, collectible, and power-up.
- Created all artwork in Adobe Illustrator, including main character, game over and tutorial screens, ability cells, and enemies.
p5.js, JavaScript
DESIGN
More with less.
In response to the inability to animate the character walking, a creative decision was made to shape the game's theme. Players take on the role of a mythical character who collects energy cells, gaining abilities from specialized cells as they progress. Each level begins with the character stripped of powers, which are gradually regained through exploration. Within the singular level, two abilities, double jump and projectile firing, are available, enhancing gameplay but not essential for completion. This creative workaround also explains character movement as gliding with magical powers.
To ensure player understanding and engagement, tutorials were integrated into the game. These tutorials systematically guide players through each new ability and energy cell they encounter, as well as instruct them on utilizing acquired powers effectively. Drawing inspiration from the Mario series, level design focused on gradually introducing and challenging players with new mechanics. The level starts with simpler and safer challenges, progressively ramping up in difficulty to test and improve player skills over time.