Im drawing a line from the players position, out in a straight line in the direction the player is facing. This is to simulate the player shooting a bullet. I want to now detect the collisions between these lines and the sprites (like buildings and other players) so that i can tell what the players bullets have hit.
Im using a LineObject from the “jewl.canvas.LineObject” package (JEWL) to consrtuct the line because i couldnt find a way of drawing a line from a set x,y an a given angle using regular java packages. Heres the code:
Point from = new Point((int)bulletStartX, (int)bulletStartY);
LineObject bulletLine = new LineObject(from, 500, player.getAngleFacing());
So anyone know how i could detect this collision? Any way to draw this line using regular java and not this external JEWL package?