Well, I was testing, to see where the issue might be coming up.
This is the final test code (including your fix):
SetVirtualResolution( 600, 480 )
global img as integer
global scnt as integer
scnt = 200
img=loadimage("img.png")
make_spheres()
do
if getpointerpressed()
if getobjectexists(1)
delete_spheres()
else
make_spheres()
endif
endif
sync()
loop
end
function make_spheres()
for i=1 to scnt
createobjectsphere(i,1,10,10)
setobjectimage(i,img,0)
setobjecttransparency(i,1)
setobjectcolor(i,random(120,255),random(120,255),random(120,255),random(120,255))
atx# = 1.0*randomsign(random(1,10))
aty# = 1.0*randomsign(random(1,4))
atz# = 1.0*randomsign(random(1,3))
setobjectposition(i,atx#,aty#,atz#)
next i
endfunction
function delete_spheres()
for i=1 to scnt
setobjecttransparency(i,0)
deleteobject(i)
render3d()
next i
endfunction
When I had scnt at 20 and without the render3d(), I could execute from my PC and repeat to my hearts content.
When broadcast to the Android Player, I could get about about 27 clicks and the next would crash it.
When broadcast to an iOS Player, it crashed on the first click.
If I set scnt to 200, the Windows version crashed on the first click. I didn't bother trying on the Players.
When I added the render3d() command in, everyone was happy.
So, it is the rendering/syncing that is killing us.
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master