In my project I was going to make the main character fight an enemy. Since you can buy different weapons in my game, some weapons are more powerful. I want to know how you can make some weapons defeat the enemy in, for example, 3 hits and another more powerful weapon in one hit. I also want to know how to make some stronger enemies die in more hits than normal ones.
Offline
Make a variable for the health of each enemy. If the enemy is weaker, give them a lower health to start with, and vice versa. When you attack, subtract from that total, depending on what the weapon you have is (for instance, a weak weapon might subtract 5 points, whereas a strong one might subtract 30). Make the enemy "faint" when their health reaches (less than) zero.
I know what I've provided you with is more concept than script, so if you have any help, feel free to ask
Offline