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

2013/12/7

removeTouching Method

UltimateCoder UltimateCoder

2013/12/7

#
I used this method to make an object disappear when it touches another certain object. However, the object disappears a bit earlier than before it touches the other object. Here is the code. { public void act() { lostBall(); } public void lostBall() { removeTouching(Ball.class); } }
Gevater_Tod4711 Gevater_Tod4711

2013/12/7

#
The problem probably is that the objects are touching but the areas which are touching each other are transparent so you don't see them. Maybe Busch2207's Pixel-perfect collision detection can help you fixing this problem.
You need to login to post a reply.