#19 | 2023-08-01 | Major Code Overhaul
Hello!
It's time to work on the next part of the player code overhaul. With music playing and soda in hand, I am motivated to work.
Setting up this script is very straight forward. I've become very familiar with referencing game objects and their components, which is crucial part to making bigger and more complex systems.
I followed this table to determine what each trigger does. Although it is almost two months old, it's still relevant because I haven't added any additional toggleable functions. I may do that later though, we'll see.
I've written the same or similar code over and over again, so I've learnt what it does and how to use it. I'm very proud of my work.
With the trigger detection script set up, the next task was to rebuild the script that handles player death. Picture below is the rough outline of the script.
Coroutines are very useful for only calling a function once, provided that you do not loop the coroutine. I love using them for various things.
When the player collides with a trap (saw or machine press), a particle effect is spawned (explosion of pixelated blood) and the player prefab is destroyed.
When the player collides with acid, there is a delay before destroying the player prefab to allow the player to sink into the acid before killing them. To make this happen, I had to tweak the PlayerController script a bit.
When the player collides with acid, the player's gravity scale is changed to a small scale to make it look like the player is slowly sinking into the acid. I'll probably use this for other liquids like molten steel or water, if I add them to the game.
With the main player scripts complete, I will completely rebuild the Game Manager scripts "SetPlayerVariables" and "RespawnManager". It's confusing to try and change aspects of them so I think it's best to do a full rebuild.
One more thing to mention: Having good version control is incredibly important. I backup my project before every big change incase I need to revert back because of a catastrophic error.
Thanks for reading and stay tuned for the next log!
Get Factory of the Damned
Factory of the Damned
2D Side-Scrolling Platformer!
Status | In development |
Author | Ice Diamond Studio |
Genre | Platformer |
Tags | 2D, Puzzle-Platformer |
More posts
- #27 | 2024-01-20 | Project EndJan 21, 2024
- #26 | 2023-09-24 | Beta v1Sep 24, 2023
- #25 | 2023-09-16 | New TrapsSep 17, 2023
- #24 | 2023-09-03 | Scaling Down DevelopmentSep 04, 2023
- #23 | 2023-08-25 | Development RoadmapAug 25, 2023
- #22 | 2023-08-24 | Alpha v2 ReleaseAug 24, 2023
- #21 | 2023-08-16 | Major Code OverhaulAug 16, 2023
- #20 | 2023-08-13 | PSAAug 14, 2023
- #18 | 2023-07-31 | Major Code OverhaulAug 01, 2023
Leave a comment
Log in with itch.io to leave a comment.