Its not adding the actor again to the world when its null
1 2 3 4 5 6 7 8 9 10 | //world //Globally int timer; //act method if (Greenfoot.isKeyDown( "4" )) { addObj(tank, 40 , 40 ); if (timer> 0 && --timer == 0 ) addObj( new tank(), 40 , 40 ); if (timer== 0 && getObjects(tank. class ).isEmpty())timer= 100 ; } |