I’m trying to add sound effects and music into my game by following the programmer’s guide here.
However, it does not work saying 'SimpleAudioEngine' has not been declared
when using auto audio = SimpleAudioEngine::getInstance();
I found this article and says to do auto audio = CocosDenshion::SimpleAudioEngine::getInstance();
and it works.
Now I need to create a global variable for audio in my .h file but I can’t figure out what the object type is. I have tried CocosDenshion* audio
, CocosDension audio
, SimpleAudioEngine* audio
and SimpleAudioEngine audio
but none of them work.
Any help would be appreciated.
Thanks