Question about coding for adding and removing health


#1

I’m curious if you would have to code a button to heal the player is health bar how would it be written?

Also to remove the enemy is health by 50 to 75% value with two other buttons.

Going with simple coding.

I built three video games in Ready Maker already and I’m always curious whats happening behind the behaviors & events we select.


#2

Hi @James! Maybe this solution:
For example, you picked up a bonus (Life). You could use a counter for this. The events example:

  1.

 Player/Sensing/Collided with Object/Bonus

 Player/CounterLife/Add/1
 Button Life/Sensing/Touch Down
 Player/CounterLife/>/0

 Life Meter/Life Meter/Add/10
 Player/CounterLife/Subtract/1

#3

Is this how it looks like in Unity?

I need to start coding my health logic in Unity first. Once that is working, add the buttons. Once that is working, I’ll be hooking up IAP to the button clicks.

Image of current UI.