This site requires JavaScript, please enable it in your browser!
Greenfoot back
cookieKeks
cookieKeks wrote ...

2019/1/23

Deleting Objects

cookieKeks cookieKeks

2019/1/23

#
Hi. I tried this code and i want the "Mauer.class" to dissapear, but when i run the code, only the "Bär.class" gets deleted
public void sterben(){ 
       if(getOneIntersectingObject(Mauer.class) != null){
            getWorld().setBackground("images/over.png");
            getWorld().removeObjects(getWorld().getObjects(Bär.class));
            getWorld().removeObjects(getWorld().getObjects(Mauer.class));
        }
   } 
This code is in the "Bär" class
danpost danpost

2019/1/24

#
cookieKeks wrote...
I tried this code and i want the "Mauer.class" to dissapear, but when i run the code, only the "Bär.class" gets deleted << Code Omitted >> This code is in the "Bär" class
Switch lines 4 and 5.
cookieKeks cookieKeks

2019/1/24

#
Thanks, man
You need to login to post a reply.