use java collision detection