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

2018/5/4

How to remove an actor when the background changes?

TiltedTowers TiltedTowers

2018/5/4

#
Hi I'm trying to make a game for my school project and I wanted to make it so that when the background changes an actor dies. Is that possible to do? Thanks
jamesN616 jamesN616

2018/5/4

#
Use removeObject() or removeObjects() in the same method used to change the background In the world, that could look something like; public void changeBackground() { setImage("new-background"); removeObjects(getObjects(Object.class)); } with Object.class being the class of objects you want to remove
TiltedTowers TiltedTowers

2018/5/4

#
Ok thanks
You need to login to post a reply.