public bool istouchingwall(wall w) { PointF nearest = w.pointnearestto(this); float distance = (float)Math.Sqrt((nearest.X - this.location.X) * (nearest.X - this.location.X) + (nearest.Y - this.location.Y) * (nearest.Y - this.location.Y)); return(this.radius > distance); }
public virtual void hitwall(wall w) { bouncefrom(w.pointnearestto(this)); }