i want to remove brick object that intersecting with the crusher. but my code it's not working. am i doing this wrong?
i'm new on greenfoot and java.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | private Actor collide; public void act() { // Add your action code here. destroy(); } public void destroy() { collide = getOneIntersectingObject(bata. class ); if (collide != null ){ getWorld().removeObject( this ); } } |