Health Bar -- Blender Game Engine


   
pageok
 
23.  Add an Expression Controller to HealthBar

Note:
The Expression Controller does 2 things:
1.  Prevents the health points being less that 0 (Health > 0)

2.  Removes health points on positive pulses from the sensor named damage (damage = True).

HealthBar selected

Buttons Window menu >> Logic (F4)
Controllers Add
Expression Controller
Exp:  Health > 0 and damage = True


  
24.  Add an Property Actuator to HealthBar

Note:
The Property Actuator will subtract 5 health points from Health.

HealthBar selected

Buttons Window menu >> Logic (F4)
Actuators Add
Property Actuator
Type:  Add
Prop:  Health
Value: -5


  
25.  Connect the Message Sensor >> Expression Controller >> Property Actuator

HealthBar selected

Buttons Window menu >> Logic (F4)
Pull wire from brass bump to brass dimple



   
  
pageok