What would be better if I were to load sounds for each level? Most of the sounds I have will be used for most of the levels and some sounds are only used for one level. Would it be wise to make all of them global and use the audio.play(sound) on each level or just make them local and load each one of them for each level before the level starts? I just read the latest article that global variables are useless so I’m just wondering what would be the best method for loading sounds without slowing down the gameplay for each level.
I would load common sounds at the beginning and level dependent ones with the level.
I would load common sounds at the beginning and level dependent ones with the level.