Hello all, thanks for helping!
I'm currently programming a spaceship game, where 2 ships duke it out.
Each ship is an image, and the lasers that fly between them are fillRects.
Ok, ok, now to the problem. Both of my ships rotate a full 360 degrees, and are very rectangular in shape. This creates a huge problem for me when if comes to collision detection, or when the lasers hit the ship.
Is there any easier way to detect if a point is in a given region (even a circular region for that matter) with out having to make an impossibly long if statement?
I'm really looking for an easy way to see if a point has entered the area in which my image or other thing takes up.
Thanks!
java.awt.Rectangle: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Rectangle.html
java.awt.Polygon: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Polygon.html
java.awt.geom.Area: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/geom/Area.html