Again, this is going to be a component, so it can be attached to either player or enemy. Overall, this was a fairly easy class to create. When creating the component, the input will dictate how much health the character has. As for functions, I made the following methods: one that subtracts from health; one that adds to health; and one that checks if the character has run out of health. If the character has run out of health, it will delete that character, and check if it was a player. If it is the player, then it's game over.
A simple, clean class, but necessary for our alpha build. Since I worked on the projectile class, this was extremely easy to test with enemy projectiles. Fortunately, it works as expected.
No comments:
Post a Comment