Health Bar -- Blender Game Engine


  
pageok
  
15.  Add a Property Sensor to HealthBar

Note:
Property Sensor >> AND Controller >> Ipo Actuator
When Health changes, the Propery Sensor (type: Changed) is triggered.

HealthBar selected

Buttons Window menu >> Logic (F4)
Sensors Add
Property Sensor
Type:  Changed
Prop:   Health

   
16.  Add an AND Controller to HealthBar

Note:
Property Sensor >> AND Controller >> Ipo Actuator
When Health changes, the health bar is updated.

HealthBar selected

Buttons Window menu >> Logic (F4)
Controllers Add
AND Controller

   
17.  Connect the Always Sensor >> AND Controller >> Ipo Actuator

Note:
Property Sensor >> AND Controller >> Ipo Actuator
When Health changes, the health bar is updated.

HealthBar selected

Buttons Window menu >> Logic (F4)
Pull wire from brass bumps to brass dimples

    
18.  Add a Message Sensor to HealthBar

Note:
Message Sensor receives a message.  This message sensor is triggered by the Subject "Heal_5Points"

HealthBar selected

Buttons Window menu >> Logic (F4)
Sensors Add
Message Sensor
Name:  heal
Subject:  Heal_5Points
       
   
19.  Add an Expression Controller to HealthBar

Note:
The Expression Controller does 2 things:
1.  Caps the health points at 100 (Health < 100)

2.  Only add health points on positive pulses from the sensor named heal (heal = True).

HealthBar selected

Buttons Window menu >> Logic (F4)
Controllers Add
Expression Controller
Exp:  Health < 100 and heal = True


   
  
pageok