L
lukeman3000
Guest
I'm following along with the Space Rocks tutorial and wanted to add a jet booster to the ship, along with a propulsion sound effect.
I got the sprite animation figured out, and the sound (to some degree). However, the problem is that while "w" is held, it doesn't just play the sound effect - it seems to start playing it repeatedly (I assume 60 new times per second, as per the step function).
So, how do I just make it start playing within a singular instance of the sound effect while the key is held, instead (and thus stop playing when the key is released)?
I got the sprite animation figured out, and the sound (to some degree). However, the problem is that while "w" is held, it doesn't just play the sound effect - it seems to start playing it repeatedly (I assume 60 new times per second, as per the step function).
So, how do I just make it start playing within a singular instance of the sound effect while the key is held, instead (and thus stop playing when the key is released)?
GML:
if (keyboard_check(ord("W"))){
motion_add(image_angle, 0.05);
image_index = 1;
audio_play_sound(Ship_Jet, 1, false);
} else {
image_index = 0;
audio_stop_sound(Ship_Jet);
}