I'm creating an escape game and just as the title says when I click on an actor I want another actor from a different world to be removed and an other actor to take it's place. I'm new to greenfoot by the way, tnak you in advance
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | public void act() { if (Greenfoot.mouseClicked( this )) { Greenfoot.playSound( "Piston.wav" ); world a = inkomthi a.removeObjects(getWorld().getObjects(keuthi. class )); a.addObjects(getWorld().getObjects(keukthi. class )); a.removeObjects(getWorld().getObjects(bibthi. class )); a.addObjects(getWorld().getObjects(bliblotthi. class )); } } public kistthi(){ GreenfootImage image = getImage(); getImage().setTransparency( 0 ); } |