Right now I have code for a counter that counts down by one each act till 0, then I need it to reset after I press a certain key but only if the counter is at 0. So something like "if counter = 0 and isKeyDown("x")". Is this possible?


1 2 3 | if ((counter == 0 ) && Greenfoot.isKeyDown( "x" )) { doStuff() } |
1 2 3 4 5 6 7 | if (Greenfoot.isKeyDown( "x" )) { if (counter = 0 ) { counter = 500 ; } } |