I just ran some tests on my app.
I've narrowed down the problem to the playback of wav files but only with the SyncRate set to (60,0).
If the SyncRate is set to (30,0) the problem does not exist.
Even setting the SyncRate to (60,0) with no sounds playing has an effect on the CPU usage, but when the sounds start playing it really spikes.
I made this code for you to try out, you'll need a couple of sound effects to use named Sound1.wav and Sound2.wav
if you set the syncrate to (60,0) (up arrow) and toggle sounds on (spacebar) you should see a big spike in CPU usage. If you turn the sounds off, or use a (30,0) SyncRate you should see the drop in CPU usage.
SetSyncRate(30,0)
Sound1 = loadSound("Sound1.wav")
Sound2 = loadSound("Sound2.wav")
syncratevalue = 30
dim Boxes[30] as Integer
for i = 1 to 30
Boxes[i] = CreateSprite(0)
SetSpriteSize(Boxes[i],5,-1)
SetSpriteColor(Boxes[i],Random(0,255),Random(0,255),Random(0,255),255)
SetSpritePhysicsOn(Boxes[i],2)
SetSpritePosition(Boxes[i],Random(20,80),50)
next i
do
if GetRawKeyPressed(40) = 1
SetSyncRate(30,0)
syncratevalue = 30
endif
if GetRawKeyPressed(38) = 1
SetSyncRate(60,0)
syncratevalue = 60
endif
Print("Current SyncRate: " + Str(syncratevalue))
Print("Press the spacebar to toggle the sound")
Print("Press the up arrow for SyncRate(60,0) or the down arrow for SyncRate(30,0)")
if GetRawKeyPressed(32) = 1
Inc PlaySounds,1
if PlaySounds > 1
PlaySounds = 0
endif
endif
if PlaySounds = 1
if Timer() > LastSound1Time# + 0.5
PlaySound(Sound1)
LastSound1Time# = Timer()
endif
if Timer() > LastSound2Time# + 0.7
PlaySound(Sound2)
LastSound2Time# = Timer()
endif
endif
for i = 1 to 30
if GetSpriteYByOffset(Boxes[i]) > 95
x = Random(1,100)
XVelocity# = x
z = Random(1,2)
if z = 1
XVelocity# = XVelocity# * -1
endif
YVelocity# = -150
SetSpritePhysicsVelocity(Boxes[i],XVelocity#,YVelocity#)
endif
next i
Sync()
loop
I saw you answered my question about the GameCenter commands in the sticky thread.
Quote: "They work, but only if your app is set up in iTunes Connect to use Game Center. They will get help entries once we update the help files, but you just call GameCenterSetup then GameCenterLogin and you can call the other commands as needed."
Will the help files be coming soon or is there anywhere I can find a list of all the GameCenter commands and the parameters they take in the beta files?