How's the way to do this...
By now I think the only way is to subclassing the menu class...there's another way or a sample source code...?
A fast, easy to use, free, and community supported 2D game engine
How's the way to do this...
By now I think the only way is to subclassing the menu class...there's another way or a sample source code...?
Is there a callback that fires when you choose a menu item? If so, just put your sound call there.
I preload my sound EFX in the init method of my MenuLayer class.
...
[[SimpleAudioEngine sharedEngine] preloadEffect:@"button.wav"];
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"menuMusic.mp3" loop:TRUE];
[[SimpleAudioEngine sharedEngine] setBackgroundMusicVolume:1.0f];
[MenuItemFont setFontSize:30];
[MenuItemFont setFontName: @"HelveticaNeue"];
MenuItemImage *showScores = [MenuItemImage itemFromNormalImage:@"BTN_SCORES.png"
selectedImage:@"BTN_SCORES_pressed.png" target:self selector:@selector(showScores:)];
...
and then I playEffect in each selector method:
-(void) showScores: (id) sender
{
[[SimpleAudioEngine sharedEngine] playEffect:@"button.wav"];
...
}i am making a menu and then starting game on same scene(with alpha tweak) is that ok??
You must log in to post.