Begin, code name "Dungeon(仮)"

Started coding like a maniac. I've brainstormed with my friends over beer while I was still in Japan. That boosted my juice to make this game.
-Watched 6 of the first Stanford class videos on iTunes U. These are great.
-Use NSUserDefaults to save user settings such as music and sound toggle.
-Choose between gender, race, class, and your name.
-Made a SoundManager class with AVAudioPlayer.

- タイトル画面の設置
- Optionsでsoundとmusicのtoggle。NSUserDefaultsで保存。
- 設定はSettingsのsingletonクラス。
- Otherのボタンは他のゲームとかホームページへのリンクなど。
- スタートボタンを押すと、性別、種族、職業、名前を選ぶ。
- musicとsoundのクラスファイル、SoundManagerを作った。AVAudioPlayerを使用。


aFilePath = [[NSBundle mainBundle] pathForResource:@"music_title" ofType:@"aif"];
titleBgmAudioPlayer = [[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:aFilePath] error:NULL] retain];
titleBgmAudioPlayer.delegate = self;
titleBgmAudioPlayer.numberOfLoops = -1;
[titleBgmAudioPlayer prepareToPlay];

- (void)playTitleBGM {
if([(NSString *)[[NSUserDefaults standardUserDefaults] stringForKey:@"SettingsMusicSwitch"] isEqualToString:@"YES"]){
titleBgmAudioPlayer.volume = gameSettings.musicVolumeSettings;
[titleBgmAudioPlayer play];

[soundManager playTitleBGM];

Is this the best way to do this?

No comments:

Post a Comment