Just started working with cocos2d, so far ive set up different scenes eg main menu, settings and about. Ive added some background music to the main menu scene like so:
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"TileMap.caf"];
The music passes through to the other scenes, but when i go back to the main menu scene the sound restarts itself.
I have only been doing this about 3 weeks now, so be easy on me :)
Thanks in advance.
you should check if background music is currently playing with [[SimpleAudioEngine sharedEngine] isBackgroundMusicPlaying], and if its currently playing just do nothing instead of calling playBackgroundMusic again in your main menu scene
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With