A friend of mine presented a conundrum regarding getting balls to bounce properly in a Pang-clone he is bruilding. Hopefully this should give some insights
@sp33dy, I believe that is due to the difference between the actual size of the image and the size of the ball itself within the image.
@2Karl, since the balls are round, maybe you should use 'getObjectsInRange' for collision checking, instead of using one of the 'intersecting' methods.
Yes, getObjectsInRange would be more efficient. the reason I used getOneIntersecting Object is because the person I was helping out is not only new to greenfoot, he's new to Java as well. rather than confuse him with optimisation from the off, I thought I'd show him the logic behind collision detection so that he can investigate more efficient methods as he develops.
Thanks for the input though guys ;)
2012/6/24
2012/6/25
2012/6/25
2012/6/28