Hello, I'm trying to iron out an animation kink I ran into. I've implemented an array which holds the frames of an animation sequence, such as an attack move.
I've been using delay() function to control the attack animation but I don't like how it freezes up everything else while the object which invoked the function animates. I would like other objects to keep animating also. Is there another function or method that'll help me with my problem?
Here's an example of my attack animation code to help clarify my problem:
attDir = 0; if(Greenfoot.isKeyDown("b")) { if(dir == 0) { attDir = dir; } else { attDir = dir+7; } setImage( attack[0+attDir] ); Greenfoot.delay(2); setImage( attack[1+attDir] ); Greenfoot.delay(2); setImage( attack[2+attDir] ); Greenfoot.delay(2); setImage( attack[3+attDir] ); }