The Last ShellBender


My Take On a 2D Platformer


I had a lot of fun making this project as my own 2D platformer. While attempting to make this project a fun experience to play, I gained a lot of newfound respect for level designers and game developement over all.

This project began with tutorial courses from Jason Weimann's Unity Mastery courses. My biggest takeaway from the these courses were the propper use of static types in game architecture. I am much more weary of the singleton pattern and only use it sparingly when creating certain manager objects. This project only had one singleton as the GameManager which kept track of the levels, Player lives, and player coins. The other use case I do enjoy for static types is static helper methods such as a helper method that I used in this project which extends the OnCollisionEnter2D class to have a method called "WasHitOnTop". It checks the normal of the collision and returns true or false if the object was collided with from the top of it's collider. I ended up using this helper method very often when checking if enemies and other object were jumped on by the player.

The biggest challenge for me in this project was getting the shells working properly. The shells work as a finite state machine and have different propperties depending on which state they are in. There are also different objects in the world which interact with shell collision differently and also different types of shells with different abilities. I have a base shell class which handles basic shell state changes and has some virtual methods on how it handles shell collisions with other objects in the world. I then have any other type of shell inherit this class and override any of the virtual methods to create the desired behavior for that specific shell. I then have an interface called ITakeShellhits which has a method that takes in an argument of an instance of that shell class. This way objects in the world can implement this interface and choose how they respond to a shell hit. Also by passing in that instance of the shell as an argument in the interface's method, that object can choose what happens to the shell upon colliding as well.

As I was building this project, different aspects of unity and C# programming really started to feel like they were "clicking" in my brain finally. I really enjoyed trying to program "reusable" modular code. For example, the flies flying back and fourth use the same code as the moving platforms. Also the moving platforms have bools that you can change in the editor for either moving all the time, moving only when the player touches them, and moving back and fourth or only in one direction. I like the idea of having customizable objects in the editor where I or any other game dev can modify the objects behavior without going back into the code. It's like a fun little challenge to code each object in the game as it's own little mini application that can be customized in different ways by simply tweaking values in the editor.