Game Development Community

Add a Sound to an image

by Landixus · in Torque Game Builder · 06/16/2011 (1:24 am) · 2 replies

I want to add a sound to an image, can somebody help me to do this?

I want to place an invisible image that plays a loop sound when player is in range,
for a gearwheel.

Thx a lot
Andreas

#1
06/17/2011 (2:18 pm)
I have played with this before and I'm not sure if my way of handling it is the best method but this is what I did.

I created a behavior that has two arguments (distance, sound file)

in the behavior it calculates the center of the image and then created a much larger image of length distance with its center at the same point as the center of the original image. Then it uses circle collision and if you collide with that image then it plays the sound with the volume based on the distance way from the center.

like I said this was just me playing around and most likely isn't the best method but maybe it will get you started.
#2
06/17/2011 (10:59 pm)
This is was i mmissing in the Editor a simple Sound editor to add some sounds.