I'm displaying anis that get sequentially further from the player.. I just don't want them all to appear at once, i want them to be visibly appearing one at a time.
Heres the timeout part. I just want the images to visibly show one at a time.
PHP Code:
function onTimeout() {
if (keydown(6)) {
for(i=0;i<=20;i++) {
if (i == 20) this.extended = true;
if (!this.extended && (i % 3 == 0)) {
//Here is where I want the sleep();
}
fx = (player.x+2+vecx(player.dir)*i*0.7)-3;
fy = (player.y+1+vecy(player.dir)*i*0.7)-2;
hideimg(i+150);
showani(i+150,fx,fy,0,"fire_scalable",((i*0.05)*random(0.9,1.1)));
if(i == 19) {
triggeraction(0,0,"serverside","flamethrower",fx,fy);
// hitobjects(1,fx,fy);
}
this.lastfx = fx;
this.lastfy = fy;
}
}
else {
this.extended = false;
for(i=1;i<=20;i++) {
hideimg(150+i);
}
}
setTimer(0.05);
}