int i = 0; int acs; Asteroid(int a) { if(a > 2) acs = a; else acs = 2; } public void act() { if((this.getX() < 5) || (this.getX() > getWorld().getWidth()-5) || (this.getY() == 399)) { getWorld().removeObject(this); } if(i == 0) { this.turnTowards(Greenfoot.getRandomNumber(getWorld().getWidth()),getWorld().getHeight()); i++; } this.move(acs/2); }