Jan. 31 - Player death
RESPAWNING AND PLAYER DEATH is really difficult. I can't really figure it out. I finally have it that when my HP reaches 0 it respawns me but:
- I go from 4 HP to 0 instantly due to each frame = 1hp damage. So by the time the enemy has turned around I am dead.
- I leave my dead bodies lying around. Check it out:
PLANNED FIXES TO THESE PROBLEMS:
To fix the first problem I will probably create a knockback effect and some i-frames to give the player some space and time to respond.
To fix the second issue...I don't know if it needs fixing. I kind of like seeing my failed corpses hanging out.
POLISH:
- To make the whole transition a bit nicer I think I'll put a small delay on the respawn so it's not so jarring. Maybe a 3 count or something.
-I have an HP Bar, but it doesn't do anything yet. It will decrease each time the player gets hit. Unfortunately, I don't know how to make it decrease smoothly, so it'll decrease in chunks. But it will get the job done. Here's an image:
OTHER THOUGHTS:
Programming is hard. If someone has some cool resources for newbs, I'd appreciate it. Specifically Unity with C#. Right now I'm patching together information from 100 different tutorials and everyone has their games set up so differently, so I'm constantly trying to take what they're doing and make it applicable to my game. For example, someone has HP and respawn in the LevelManager/GameSession etc. Another will have it in the PlayerController. So figuring out the best way for my game to work can get confusing. I sort of feel good about getting this far, though.