カウントダウンはInGameTime
、フレームごとに更新される値を使用して1秒ごとに更新されます。
ゲーム時間を最も近いintに丸めることができるので、これは視覚的にうまく機能します。
...しかし、アプリで毎秒ビープ音を鳴らすにはどうすればよいですか?
以下は私のコードです:
-(void) setTimer:(ccTime) delta{
int timeInSeconds = (int)appDelegate.InGameTime;//Game time E.G: 8.2332432
/*
Stuff is here to display the tempTime
*/
//The below effect plays the sound every frame,
//is there an equation that I can apply to appDelegate.InGameTime
//that will play it once a second?
[[SimpleAudioEngine sharedEngine] playEffect:@"tick.mp3"];
}