My new game craches on my iPad 1 but not on my new iPad.
Is there a way to detect device version in Tier1?
My game craches when I use explosions.agc (from the forum)
init_explosions:
rem dim arrays
type explType
spr as integer
frame as integer
endtype
global dim explosion[25] as explType
rem load images
for i=1 to 35
num$ = str(i)
if i<10 then num$ = "0" + num$
imagename$ = "exp" + num$ + ".png"
loadImage(2000+i,imagename$)
next
return
function spawn_explosion(x#,y#)
e = find_free_explosion()
if e>0
ei = random(2001,2035)
spr = createSprite(ei)
setSpriteAnimation(spr,128,128,30)
setSpriteFrame(spr,1)
setSpriteSize(spr,128,128)
setSpriteOffset(spr,64,64)
setSpritePositionByOffset(spr,x#,y#)
setSpriteAngle(spr,random(1,359))
setSpriteDepth(spr,0)
explosion[e].spr = spr
explosion[e].frame = 1
endif
endfunction
function find_free_explosion()
for e=1 to 25
if explosion[e].spr = 0
exit
endif
next
if e>25 then e=-1
endfunction e
function update_explosions()
for e=1 to 25
spr = explosion[e].spr
if spr > 0
f = explosion[e].frame
inc f
if f>30
explosion[e].spr = 0
deleteSprite(spr)
else
setSpriteFrame(spr,f)
endif
explosion[e].frame = f
endif
next
endfunction
In my loop I use this:
Gosub init_explosions
Repeat
//** Make explosions
spawn_explosion(Random(0,1024),Random(0,768))
update_explosions()
sync()
Until FinishWinner = 1
It works okay on the iPad simulator