Log In  

I've been trying to make a nice sound for my game 'StarBase' for when the ship is flying around but I can't seem to get it right. The sounds are always played too far apart so that there is a gap or overlap so that it 'crackles'.

I've tried playing the sound every 4 frames (for example) and changing the speed of the sfx itself as well as how many notes are in the sfx but still no luck.

Any ideas on how to get a nice sounding sfx loop?

P#41042 2017-05-27 06:16 ( Edited 2017-05-28 20:17)

did you try the actual loop option in the upper-right corner of the sfx editor?

P#41044 2017-05-27 12:21 ( Edited 2017-05-27 16:21)

Ah no I didn't even see that... I'll try using it now!

I've tried using loops now and have something like this so far:

if dir_pressed() then

The sound still seems to be starting every frame with this code though so I'll need to play around with the code a bit more.

P#41078 2017-05-28 10:45 ( Edited 2017-05-28 14:45)

That's because, if I understand your code correctly, you are checking every update frame and so playing every update frame.

What you need to do is tracking the change from no direction being pressed to any direction being pressed and back again.

key_down = False

function _update()

if not key_down and dir_pressed() then
 key_down = True
elseif key_down and not dir_pressed() then
 key_down = False
P#41083 2017-05-28 13:03 ( Edited 2017-05-28 17:07)

Yes I realized that but was trying to think of ways to remedy it, I've found a solution now using a timer but your way would work much better I feel.

Thanks for the replies everyone, exactly what I needed!

P#41091 2017-05-28 16:17 ( Edited 2017-05-28 20:17)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-08-08 09:28 | 0.011s | 4194k | Q:21