This site requires JavaScript, please enable it in your browser!
Greenfoot back
h123n
h123n wrote ...

2012/5/4

what can I do for my world to wait an amount of time?

h123n h123n

2012/5/4

#
Hi is there some sort of way of making greenfoot wait for a bit? its like I want it so it can show an animation but loads of pictures take forever to draw.ps I wont give code because I have no idea how to use this.
tylers tylers

2012/5/4

#
Greenfoot.delay(int time)
hope it works
h123n h123n

2012/5/5

#
I type in Greenfoot.delay(int 5) and it comes up with .class expected!? what should I do?
bourne bourne

2012/5/5

#
tylers wrote...
Greenfoot.delay(int time)
hope it works
The "int" here just means what type "time" is. So just use Greenfoot.delay(5)
h123n h123n

2012/5/5

#
Thanks!!!
h123n h123n

2012/5/5

#
My Greenfoot won't go in a sequence here is my code:
mport greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class sausageNinja1 here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class sausageNinja1 extends Actor
{
    /**
     * Act - do whatever the sausageNinja1 wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
       Greenfoot.delay(5);
       {
       Actor beginning;
       beginning = getOneObjectAtOffset(0, 0, beginning.class);
       if (beginning != null)
       {
           World world;
           world = getWorld();
           world.removeObject(beginning);
        }
    }    
}
}
bourne bourne

2012/5/5

#
You have extra brackets. Remove the ones at lines 18 and 29. And make sure you have an 'i' for "import" at the first line.
You need to login to post a reply.