I have a zebra and I need it to change into a tornado for like 10 seconds and then into a unicorn. But I can't get it to work. This is the code that I have for my Zebra; how can I change it make it work.
public class Zebra extends Actor
{
public void act()
{
if(Greenfoot.isKeyDown("1"))
{
setImage("tornado.png");
Greenfoot.delay(10);
setImage("unicorn.png");
}
if(Greenfoot.isKeyDown("5") )
{
setImage("explosion.png");
}
}
}