A 2D Puzzle Platformer
Gravity Balls is named that because I couldn't think of anything better. In this puzzle platformer the objective is to get the correct ball into the correct color coded pocket. Each ball has a specific personal gravity where they fall towards their corresponding color’s edges. This isn’t a complete game, I just like gravity mechanics and wanted to see if I could make something work.
Move around with WASD or arrow keys and jump using spacebar, press again while in the air to do a double jump. Use the tab key to toggle between personal gravity and world gravity (red by default). You'll know it's on when you're glowing red. When you get close to another wall, left click to switch to that wall’s gravity. The gravity you switch to is based on the last up, left, or right collider the character has hit. In the case of multiple collisions it will stick you to the WASD direction you are holding down. If no direction is being held then the default is to gravitate to the last collider that was activated. Press the R key to switch between a character chase camera and a static camera.
In addition to personal gravity the world’s default red gravity can be changed (currently using 7890 for up, down, left, and right). Ideally the level designer will use this with additional obstacles. Personal and world gravity strength can also be altered. The object’s and player’s gravity can also be altered as well: light, normal, or heavy. The player also has extra abilities depending on the active gravity. Light gravity: jump higher but not as far (like Luigi) and holding down the spacebar lets you hover. Heavy gravity: a lower but further jump (like Mario) and holding down left shift triggers an accelerated smash. Normal gravity: a regular jump with no abilities.
I learned a couple of things in this project including binary properties for determining the last touch collider. I also made a Cinemachine clone before I found out about Cinemachine. The camera now follows the player and stays in the level bounds. Expanded my knowledge on Gizmos, forces, scene gravity, physical materials, and Unity's 3% extra collider area that kept getting my character stuck in tight spaces.