I'm back and longer in doubt

For questions about using Classic.

Post » Tue Mar 29, 2011 11:12 pm

Hello Guys, I'm back here in the forum. I was working on a project in which its continuance was not possible because an unknown error and this error was posted here on the forum and can not be resolved. and I had no choice but to redo the whole game ...

I'm with a doubt over the course of this project projeto.No the main actor in that case is a car that is composed of two parts, the bottom has a car and even there behavior is okay, but the top is controlled by and mouse with the left mouse button shoots the car ... But I made a shooting sound in Sony Acid Pro 7.0 and when I put the sound to play along with the shot, the sound is repeated thousands of times in one second and not can understand nothing of the sound ... I was wondering a way to decrease the speed of sound or put it in real time ... If I'm using xaudio and the event (Autoplay file) ... Help me?
B
1
G
2
Posts: 9
Reputation: 643

Post » Tue Mar 29, 2011 11:20 pm

For the repeating sound problem, use the condition "Trigger once while true" under "System". That should work.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Thu Mar 31, 2011 8:29 pm

thanks for your tip SullyTheStrange, but the gun is a chaingun, and so the shot has to be straight, and the sound would have to be repeated yes, but in real time. The condition that you said, the sound repeats every mouse click, and would have to be straight as a chaingun ... It worked with Condition (Every X miliseconds) and (Left Mouse Click) ...


but thanks for the tip ....
soon, I put the game here in the forum ...
B
1
G
2
Posts: 9
Reputation: 643

Post » Fri Apr 01, 2011 2:42 am

This might be a little bit of a long winded way of doing this, but you could have the player have a private variable called something like, 'shotCounter' and do something like the following:

when player has shoot button down:
--->add timedelta to shotCounter

if shotcounter is equal or greater then 200 (you may want to raise or lower this value)
--->play the sound
--->put your shoot code here
--->set shotCounter to 0

If that doesn't work, you could put the trigger once while true as a subevent to the shotCounter > 200ish with the sound action within that :)
Hope that helped

EDIT: The only real benefit to using this way over the way you mentioned, is that you can at least make it so it fires STRAIGHT when you click, rather than waiting a little sometimes
EDIT2: You could also apply this to enemies if you want them to fire are their own independent rates, rather than all shooting at the same time
B
3
S
2
G
5
Posts: 351
Reputation: 2,377


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest