There are hitboxes in the form of a rectangle. they can rotate and move.
How to search for "collisions" of these rekthangles?
There are hitboxes in the form of a rectangle. they can rotate and move.
How to search for "collisions" of these rekthangles?
Perhaps in javafx there is such a function intersects. Here is an example:
//Создаем хит-боксы Rectangle playerHitBox = new Rectangle(...); Rectangle enemyHitBox = new Rectangle(...); //Проверяем на столкновение if (playerHitBox.intersects(enemyHitBox)) { //Дальше реагирование на это столкновение } Source: https://ru.stackoverflow.com/questions/672507/
All Articles