sound trigger
Blitz3D Forums/Blitz3D Beginners Area/sound trigger
| ||
I am pretty sure someone has written about this but I cannot find it in search or by scanning the forums so i will simply be a boor and ask again (though first time for me...) Is there some way to plant a sound trigger in my map? Is there some way to play a sound only when entities collide? This must be possible and certainly I am probably too dense to figure it out. If someone can help me by posting even the psuedocode the loud slapping noise you then hear will be my hand helping myhairline to receed further!!! |
| ||
Don't all reply at once! |
| ||
Pseudocode: If a collide with b then playsound After setting up collisions you can check if an entity collide with another by calling entitycollided. If you want a sound to be in a specific area then you must check if the player is in the area. Pseudocode: If player in area If sound not playing play sound Else If sound playing stop sound End If |
| ||
Ahhh... OK. I was a bit worried about the IF/THEN statements slowing down the clock a bit but it seems fast enough. B3d has a microphone example that is supposed to diminish the sound from a distance based on the distance to the entity but all ways I have tried it have simply not worked and the example is clear as mud. I am trying yours now. :) |