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
Get Don't Be Afraid To Fall
Don't Be Afraid To Fall
Status | In development |
Author | Martin Mihálik |
Tags | mff-gdintro-2021-c |
More posts
- Journal Entry 10: Time is upSep 19, 2021
- Journal Entry 9: Change of PlansSep 18, 2021
- Journal Entry 8: Finished Refactoring and Repeating WorldSep 17, 2021
- Journal Entry 7: Pausing and RefactoringSep 16, 2021
- Journal Entry 6: Walls and Automatic Meteor SpawningSep 15, 2021
- Journal Entry 4: Explosions and RubbleSep 13, 2021
- Journal Entry 3: Fixed Movement and MeteorsSep 12, 2021
- Journal Entry 2: Terrain and Player ControlsSep 12, 2021
- Journal Entry 1: The Design and PlanningSep 10, 2021
Leave a comment
Log in with itch.io to leave a comment.