Hi,
Could you please help me with this. how can I make a pause for one second between two action of objects or methods.
I tried these two methods "wait" and "delay", but they didn't work.
the code which I need a method to make a pause or delay for one second, is as below:
Thanks,and it is appreciated in advance. :-)
public class FivePence extends Money
{
private int n;
/**
* Act - do whatever the FivePence wants to do.
*/
public void act()
{
insertMoney();
cr5();
}
/**
* Moving the coin into the Coin Insertion, when this coin is clicked by mouse.
*/
public void insertMoney()
{
if (Greenfoot.mouseClicked(this)) {
setLocation(517, 314);
}
}
/**
*
*/
public void cr5()
{
int n;
n = 5;
getImage().drawString("Credit: " + n, 592, 170);
}
/**
*
*/
public void getBack()
{
World world;
world = getWorld();
getWorld().addObject(this, 589, 416);
}
}



