Journal Entry 5: Rubble Collection and Damage System


Date: 14.  9. 2021

My first task today was making the rubble collectible. However, before I got to that I noticed only 2 pieces of rubble spawning occasionally. Turns out all of the pieces spawned successfully, some of them just got stuck inside the platforms. I fixed this by making sure the random area rubble can spawn in never overlaps with platforms.

Making the rubble collection was quite easy, I wrote some quick scripts and tweaked the layer collision matrix a bit. I had some trouble with rubble not despawning, turns out I was destroying only the collectible sub-object instead of the entire rubble instance.

Creating the damage system definitely took longer than expected. The principal burden to overcome was preventing taking damage both from meteor impact and subsequent explosion caused by this impact. My first idea was based on remembering instances of DamageDealer component and refusing to take damage multiple times from single dealer. Then I wanted to make the created explosion to share the DamageDealer component instance with the meteor, however, it turns out this is not quite possible. After some experimentation with different methods I finally settled with basically the same idea, just instead of sharing the instance every instance would have an id attached and meteors and explosions share those instead.

Files

Day4Build.zip 22 MB
Sep 14, 2021

Get Don't Be Afraid To Fall

Leave a comment

Log in with itch.io to leave a comment.