示例#1
0
 public final boolean collides(Entity other) {
   return other.dist(this) < radius + other.radius;
 }
示例#2
0
 // changes the direction of an object calling this function by checking to
 // see whether a new direction will get it closer to the heading that it wants;
 // double t is the current heading
 private boolean isCloser(double t) {
   double dx = Math.cos(theta) * targetVel, dy = Math.sin(theta) * targetVel;
   double tdx = Math.cos(t) * targetVel, tdy = Math.sin(t) * targetVel;
   return target.dist(x + dx, y + dy) > target.dist(x + tdx, y + tdy);
 }
示例#3
0
 public Helper.Intersection intersectPoint(Entity other) {
   return Helper.intersectPoint(getBounds(), other.getBounds());
 }