Progress Report 5

27/11/2023

New Temp Sprites

I wanted to get that Claymation aesthetic going early, but I have no artistic ability, so I borrowed a walk cycle from Animatoror on Youtube
Unity_3tT8wkaEaQ.gif

New Player Controller

I didn't like the old player controller made by Tarodev because it wasn't rigidbody based, meaning physics interactions were more janky
So I looked online and used a simple one by Bendux

Sticking the player to moving objects

Made a PlayerStickSurface.cs script which is placed on object which you want the player to stick to when they are on, for example the moving platform or rocks
Originally I had the players become transform children of the object, but I had problems with the rocks that would scale up as an animation causing the players to scale with them as the objects child
So I switched to the stick surface object to track each player touching it, recording how much its moved since the last frame, and adding that to the players position

Health Bar & Visualization of Damage

Added health bar & health system
Everything that has traditional health (players, NPC's, etc.) uses the AttributesManager.cs script
The script is a modular way to track health, damage events, and death events
I want to add functionality for healing, called regeneration, and passive regeneration to the script
The script also uses UnityUI sliders to display the health just above the player

Visualizing Damage

Also added the SpriteFlasher.cs script, which can be called to change the colour of the sprite renderer for a set amount of time
In this case, using it to flash the players sprite red for a split second to indicate damage
Unity_fFJwQW4XQl.gif|504

Invoking Damage

Also added 2 damage scripts, CollisionDamage.cs & MagnitudeDamage.cs

CollisionDamage.cs Damages the collided AttributesManager.cs containing object with a set amount of damage. The owner of the CollisionDamage.cs object can also be defined, that way their own object cannot damage them.
MagnitudeDamage.cs Damages the collided AttributeManager.cs containing object with an amount of damage that is multiplied by how hard the collision happened (the magnitude of the collision). The collision can also have a minimum magnitude before doing damage, so a slow moving MagnitudeDamage.cs object doesn't just fall apart and do nearly no damage on slight impact. In the gif above, I am using the OnDamage event to destroy and replace the object once it hits an AttributesManager.cs containing object