1 decade ago by KenD
What's the best way to defer loading of sounds for entities used on later levels? I've got ~14MB of sounds and I'd rather not load them all up front. In the docs, it mentions
I have my entities split up according to which level they&
All sound and image files that your game needs should be loaded by the preloader, so that they are actually available when needed.
Calling the .draw() method on an image that has not yet been loaded, will do nothing. Attempting to play a sound file that has not been loaded, will result in a severe lag.
I have my entities split up according to which level they&
039;re on, so if I create the necessary sounds in the entity's #init()
method, will that start loading the sounds as soon as the game starts, or will they not begin loading until the level loads, since they're not referenced anywhere outside the level?