示例#1
0
 private boolean hitSquare(Point p, Square s) {
   int size = Utility.getWidth(s);
   return (Math.abs(p.x) < size / 2 && Math.abs(p.y) < size / 2);
 }
示例#2
0
 private boolean hitRectangle(Point p, Rectangle r) {
   int width = Utility.getWidth(r);
   int height = Utility.getHeight(r);
   return (Math.abs(p.x) < width / 2 && Math.abs(p.y) < height / 2);
 }