przemoo83 Posted February 22, 2015 Share Posted February 22, 2015 Hi I have this problem with the sound of firing //just shoot else if(this.game.input.activePointer.isDown) { throwS.play(); fireBullet(); player.animations.play('throw'); }It works nicely when mouse button is clicked once. However when the button is pressed and held down for a while, sound is not played until the buton is released. Is there any way to change this behavior? Link to comment Share on other sites More sharing options...
ZeroGravity Posted February 23, 2015 Share Posted February 23, 2015 I am not sure at all, new to Phaser, just an idea. Maybe you should check if your sound has played to the end (if it's very long sound), by checking isPlaying like this: //just shoot else if(this.game.input.activePointer.isDown) { if(!throwS.isPlaying) throwS.play(); fireBullet(); player.animations.play('throw'); } Link to comment Share on other sites More sharing options...
przemoo83 Posted February 24, 2015 Author Share Posted February 24, 2015 I am not sure at all, new to Phaser, just an idea. Maybe you should check if your sound has played to the end (if it's very long sound), by checking isPlaying like this: //just shoot else if(this.game.input.activePointer.isDown) { if(!throwS.isPlaying) throwS.play(); fireBullet(); player.animations.play('throw'); }Thanks for the answer but it doesn't solve the problem. The sound i play is very short. It's a sound of throwing. Link to comment Share on other sites More sharing options...
Recommended Posts