Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by fugufish

Is there a "pause all sounds" function in Impact? I checked the sound.js file, couldn't find such thing.

a great use would be:

say the user pauses the game, all sounds will pause too.

Eg: earthquake sound in biolab disaster lasts around 5 secs. It would be weird if the game pauses, but the earthquake sound is still playing away.

1 decade ago by MobileMark

How are you pausing the game now?

1 decade ago by fugufish

it's kind of a stretch, what i'm doing now.

i'm using soundManager2 as my sound plugin (it has a 'pauseAll' function), instead of Impact's default sound.js

for pausing the game, I use this in my main.js:

window.addEventListener("blur", function () {
	if (ig.system) {
		if(ig.game){
			ig.game.font.draw('Game Paused',ig.system.width/2,ig.system.height/2,ig.Font.ALIGN.CENTER);			
		}
		ig.system.stopRunLoop.call(ig.system);
		soundManager.pauseAll();
	}
}, false);

window.addEventListener("focus", function () {
	if (ig.system && gameRunning ) {
		ig.system.startRunLoop.call(ig.system);
		soundManager.resumeAll();
	}
}, false);
Page 1 of 1
« first « previous next › last »