I want to show how much damage the sprite dealt on a Life Bar. For Example. if sprite 1 damages sprite 2, sprite 2's life bar is lowered. Can anyone help me?
THANKS
PS. I know how to make the Life Bar, but I have troubles with the damage part.
Offline
This depends on how you sense the damage.
Here's one way:
in the p1 sprite:
if p1 attacking
if touching p2
change p2health by -1
in the p2 sprite:
if p2 attacking
if touching p1
change p2health by -1
But for this way, the p1health and p2health variables would need to be created "for all sprites"
Does this help?
If not, upload and we'll take a look at it.
Offline
Well your script is wrong if p2health is the same sprite as p2
Offline
JTxt wrote:
This depends on how you sense the damage.
Here's one way:
in the p1 sprite:if p1 attacking
if touching p2
change p2health by -1in the p2 sprite:
if p2 attacking
if touching p1
change p1health by -1But for this way, the p1health and p2health variables would need to be created "for all sprites"
Does this help?
If not, upload and we'll take a look at it.
Offline