I’m working on a game for this game jam. I’m making it in java because I can’t be bothered to learn a game engine. I’m using JFrame as my graphics library, and I can’t think of a way to detect collisions between my player and the 2d world. Here’s the link to the github page: https://github.com/DJPretzel-bit64/UnderAdventure.git
>Solution :
The simplest way is to represent your actors with the implementation of java.awt.Shape (say Rectanlge2D). That implementation would have boolean intersects(Rectangle2D r) already implemented for you.
So your job would be to pre-filter shapes so that they are reasonably close to your target actor, predict a move of those candidates and test for intersections if they would be at predicted points.