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. :-)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 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 ); } } |