rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
469 stars 49 forks source link

Sound file unloading #16

Open Tapsi opened 9 years ago

Tapsi commented 9 years ago

Hi,

I saw playground does not implement an ability to unload sounds. The ability to unload music files especially in terms of big music files on mobile devices to save RAM.

Is there a reason why something like playgroundApp.unloadSound(soundId) does not exists yet? If it's possible to add this ability into the main branch then I could provide a patch ( I need to create the ability anyway for my game :) ).

rezoner commented 9 years ago

Sorry for the late reply, I have a busy time lately.

Yesh, it is totally reasonable to add unloadThings to Playground. You should store this method under PLAYGROUND.Application.prototype.unloadSound = function(key) { }

Let me know if you managed to do that or you want me to add it.