is there a way to pause and resume the scenario with the same button? currently i have to hold escape for it to stay paused.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | if (Greenfoot.isKeyDown( "escape" )) { pause Pause = new pause(); addObject(Pause, 500 , 250 ); change= "space" ; while (! "escape" .equals(change)) { change=Greenfoot.getKey(); Greenfoot.delay( 1 ); if (Greenfoot.isKeyDown( "z" )) {Greenfoot.setWorld( new menu()); } } removeObject(Pause); } |