bañaperras wrote...
Hello, do you know any method so that when the lives of an object are removed, it drops an object and reappears in another place and thanks for the previous code, it worked for me :)addObject( obj, Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()) );
if(isTouching(turle.class)) { removeTouching(turle.class); getWorld().addObject (new turle(), 60, 20); }
//In Object class Actor coffin = (Actor)getWorld().getObjects(Coffin.class).get(0); if(life==0) { getWorld().addObject(coffin, getX(), getY()); getWorld().removeObject(this); } //In world if(getObjects(Object.class).isEmpty()) addObject(obj, Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()) );
Actor coffin = (Actor)getWorld().getObjects(Coffin.class).get(0);
Actor coffin = new Coffin();