Game Development Community

Need help with something???

by Sean Pollock · in Torque Game Engine · 05/08/2003 (8:57 pm) · 3 replies

Hi,

Here is what I want to do and was wondering if anyone knows how I might accomplish this.

I want to implement a heart beat sound for when a players health falls below a certain percentage like say 50%. I am not sure how to do this so if anyone knows how I might implement something like this I would love to hear from you.

Thanks in adavance.

#1
05/09/2003 (1:46 pm)
I imagine that you'd create an audioprofile and/or description for the heartbeat sound inside the player script. In the onDamage function, you'd check for damage falling below a point, and if it's below the threshold, you execute an alxPlay for that handle. I guess if it's a looping sound you have in mind, you'd probably want to have an alxStop on health pickup (and if it goes above threshold).
#2
05/09/2003 (1:52 pm)
sure setup the audio.
but I would play it once not looped.
so everytime its played it schedules the next play.
based on how much health there is.
that way you can space the beats if your running low on life.

using a self scheduling function in the damage would handle this.
some tweaking and it could work real nice
#3
05/11/2003 (11:45 am)
thanks guys for all the help. I really appreciate it and will try your suggestions today.

Thanks again.