I need to incorporate the while and for loop, even though it is not necessary
. Can someone tell me where I'm going wrong, please?
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 | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class BabySpawner extends Actor { private int x = 0 ; int counter = 0 ; public boolean SpaceShip = true ; public void act() { counter++; while (counter > 50 && deathcheck() = true ) { if (counter == 50 ) { for ( int x= 0 ; x< 3 ; x++) { aestroid aestroid = new aestroid(); getWorld().addObject(aestroid,( int )(Math.random()* 100 ),( int )(Math.random()* 600 )); } counter = 0 ; } } } public void deathcheck() { if ((SpaceShip. class ) = null ) { return false ; } } } |