Link to the game: He Vs Lizard Things
The fourth of the prototypes was a 2D platformer where the player runs and jumps around a level avoiding spikes and enemies trying to get to the top.
Design and Sprites
I decided on a fantasy type thing for this, with whatever creature the player is and the lizard enemy thing. The enemy and player both have idle animations with the player having walk animations as well. The tiles were pretty standard dirt, grass, crate, and spikes from every other platformer.






The Scripts

The player’s walk animations are done using different values depending on which direction the player is facing. In the animation station these values will control which animation, and therefore which direction the player will face when they walk.

The jump script initially checks whether the player is touching the ground, if they are not then isjumping is true, if isjumping is true and they are grounded then isjumping is now false. This allows the code to check, once the space bar has been pressed, if the player is already jumping and, if they are, prevent them from jumping again. But if they arent jumping then the jump goes through.
If the player jumps on an enemy’s head then they die. But instead of just disappearing they bounce a random range of x and y away and have their rigidbody turned off, meaning they no longer collide with anything and follow their bounce through the ground and off the screen.

However, that only works if the player hits the top of enemies. If the player hits the sides or bottom of enemies, or anywhere of spikes, then the player is destroyed

The gameManager constantly checks if it can find the player. If it cant find the player character because they have died, the code will reset the scene by loading it again. There is also the press escape to close the game QoL feature.

Because the player is moving around an environment bigger than the camera, the camera needs to follow them. As long as the player isnt null or is alive, it will follow them.

Changes I Would Make Next Time
I think next time I would add quite a few things such as a menu screen, an attempt counter that counts the number of deaths a player has had. This would pair well with the quick restart system that the game uses at the moment and would most likely function similar to that of Geometry Dash. I would also add a win area to the level, probably with a collider with no rigibody so when the player meets it, they wont be affected movement wise but the collider can trigger an on screen message or a button for the next level.