void OnTimer()
{
// This repeats 30 times a second
int accx;
int accy;
accx=TiltGetx();
accy=TiltGety();
bx=ViewGetx(bv)+(accx / 100);
by=320;
if (bx < 0)
bx=0;
if (bx>295)
bx=295;
ViewSetxy(bv,bx,by);
}
I need a code that allows me to spawn an instance from 0,0 to 0,295 (instance name enemy.png) it needs to have a 1/30 chance of spawning because the script will loop 30 times a second. Please help