Health Bar -- Blender Game Engine


 
pageok


  
1.  Add an Keyboard Sensor to the Player

Note:
Keyboard Sensor >> AND Controller >> Message Actuator
The message actuator sends the message "Heal_5Points" to the HealthBar message sensor.

Player selected

Buttons Window menu >> Logic (F4)
Sensors Add
Keyboard Sensor
Key:  Uparrow


  
2.  Add an AND Controller to Player

Player selected

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

   
3.  Add a Message Actuator to Player

Note:
The message actuator sends the message "Heal_5Points" to a Message Sensor connected to HealthBar.

Player selected

Buttons Window menu >> Logic (F4)
Actuators Add
Message Actuator
To:  HealthBar
Subject:  Heal_5Points

  
4.  Connect the Keyboard Sensor >> AND Controller >> Message Actuator

Player selected

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

   
5.  Add a Keyboard Sensor to your Player.

Note:
Keyboard Sensor >> AND Controller >> Message Actuator
The Downarrow will trigger the Message Actuator to send a message to the HealthBar to decrease the health by 5 points.

Player selected

Buttons Window menu >> Logic (F4)
Sensors Add
Keyboard Sensor
Key:  Downarrow

 
 
 
pageok