I'm back and longer in doubt

This forum is currently in read-only mode.
From the Asset Store
Helping streamers give their viewers more excitement.
  • 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?

  • For the repeating sound problem, use the condition "Trigger once while true" under "System". That should work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 ...

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)