   [java] Gigglily simple polygon collision...
  So recently I found out that my old collision testing code had a few "horrible" bugs in it that were worth fixing latter.   So I ended up procrastinating on it while I worked on the "prettier things" like graphics and ended up finding the "Area" class hoping it had some functionality that it didn't and found out it had a contains(rect), contains(x, y) which I promptly decided to test right and ended up working surprisingly well(with almost 5 million tests a second(triangle) on a netbook, along with rendering).package race;import java.awt.Polygon;import java.awt.geom.Area;public class Poly {private int x[], y[];  //list of x, y locations of the polygonArea myArea;Poly(int x[], int y[]){this.x=x;this.y=y;myArea=new Area(new Polygon(x, y, x.length));}Poly(String XMLPath){}public int[] getX(){return x;}public int[] getY(){return y;}public int getLength(){return x.length;}public boolean collision(double xCord, double yCord){return myArea.contains(xCord, yCord);}}internet cookies to whoever tells me how to use the code tag.   Thanks for the help.[Edited by - lithos on June 26, 2009 5:04:47 PM]
  Most of the forum tags use square brackets instead of angle brackets.  You can choose between  (no scrolling window) and [ source ] (scrolling window).  (I added extra spacing to prevent the tags from actually being used in this post)