JavaFX Node class provides two intersect methods:
intersects(Bounds localBounds);
and
intersects(double localX, double localY, double localWidth, double localHeight);
When and how can I use these methods?
JavaFX Node class provides two intersect methods:
intersects(Bounds localBounds);
and
intersects(double localX, double localY, double localWidth, double localHeight);
When and how can I use these methods?
as it name tells it is used to determine if a node is intersected with other node or not..
Example : If you're going to develop Zen pong game in javafx ,if ball hits the wall behind paddle then game over.
Code :