Game Development Community

Health Bar SFX

by Harvey Greensall · in Torque Game Engine Advanced · 10/27/2008 (1:09 pm) · 1 replies

Hi All,

Our game's almost finished, I'm fine tuning audio...

Anyone got a good way in script to trigger a sound when your health bar is at say 20%....so we get a warning before you die? I'm trying not to disturb our overworked coder who's fixing bugs bugs bugs....

Just an example of how it would work in any GGs demo would be amazing !!!

Many thanks in advance....as always !!

Harv.

#1
10/27/2008 (7:40 pm)
If you're doing it in script, you could easily tie-in to wherever your damage functions are handled...

Shapebase::onDamage or something similar.. then make a call to getDamageLevel() on the player or object passed... then you'd have to setup a client and server command..

Or, depending on the gui control that I assume you're using, there might be a script callback which could be intercepted to determine how much of the gui control is drawn/progress of it..