Sound on hit

For questions about using Classic.

Post » Wed Apr 13, 2011 6:40 pm

What I'm asking is not the normal explosions on bullet but what conditions would I need to use to make a sound play when another object is over it? I know already that I need on object is over but how do I make it so the sound doesn't play once the object has gone off the other object?
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Wed Apr 13, 2011 6:51 pm

[quote="briggybros":39syk95y]but how do I make it so the sound doesn't play once the object has gone off the other object?[/quote:39syk95y]

Not quite sure what you mean by this. Are you not destroying the bullet when it hits the object in the first place? If you aren't, you probably should (unless you're not doing it on purpose), but either way the problem would probably be solved by using the Trigger Once condition.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Wed Apr 13, 2011 7:01 pm

The game I'm making is a magic game and when you cast your spell you can control it's direction with your mouse (If it's the right type of spell) and some of the enemies are quite (Very) big and my sound is just about one second long and some of the enemies are so big I've managed to keep the spell on them for about 5 seconds, And it still doesn't kill them. But every time I... ...(would pausing the sound work?)... ...Is there a way to trigger something if it isn't on another?
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Wed Apr 13, 2011 7:10 pm

Alright, I think I get what you mean. You want the sound to keep playing while the spell is over the enemy, and then stop once it's off, right?

That's a little trickier than a normal sound effect, but it's doable. You should load the second effect into a specific channel first and set it to loop(make sure the effect actually sounds good when looping!), and play it while the spell overlaps the enemy. Add another condition that says when the spell DOESN'T overlap the enemy, stop playing that channel.

It's possible there's a simpler way to do it, but I did a similar thing in my own game using this and it works fine.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Wed Apr 13, 2011 7:32 pm

What's the condition when it doesn't overlap
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Wed Apr 13, 2011 8:03 pm

You can invert conditions if you right click them, so make another condition where they overlap and invert it. An inverted "This overlaps this" means "This doesn't overlap this".
B
20
S
9
G
6
Posts: 607
Reputation: 6,112


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests