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

2013/12/14

Removing objects using coordinates?

ADog ADog

2013/12/14

#
I've been working in Bluej for almost a year in school and just moved into Greenfoot more recently! I'm wondering how to remove all object(s) in a specific coordinate. To Note: 1) All objects, not specific class objects.(all classes) 2) Whether there is an object there or not. 3) Using from within a subclass of the world class I'm open to all suggestions and workarounds! My object classes are Ground and Coin currently… just for reference if a workaround is needed! Thanks!
danpost danpost

2013/12/14

#
If working in your subclass of World, 'removeObjects(getObjectsAt(xCoord, yCoord, null));'. If working in an actor class, prefix the above with 'getWorld().' (with the dot).
ADog ADog

2013/12/14

#
Thanks that was much simpler than I had thought!
You need to login to post a reply.