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 void createborders() { wall wall1 = new wall(0, 0, 30, levelheight); walllist.Add(wall1); wall wall2 = new wall(0, 0, levelwidth, 30); walllist.Add(wall2); wall wall3 = new wall(0, levelheight - 30, levelwidth - 30, 30); walllist.Add(wall3); wall wall4 = new wall(levelwidth, 0, 30, levelheight - 30); walllist.Add(wall4); }
public void addwall(int top, int left, int width, int height) { wall wall1 = new wall(top, left, width, height); walllist.Add(wall1); }
public override void hitwall(wall w) { this.destroy(); }
public virtual void hitwall(wall w) { bouncefrom(w.pointnearestto(this)); }