Example #1
0
 // As above, using the other object's boundingRadius
 public bool IsTouching(VisibleObject other)
 {
     return(IsTouching(other, other.boundingRadius));
 }
Example #2
0
 public MessageNotifyCloseToObject(VisibleObject closeToObject)
 {
     this.closeToObject = closeToObject;
 }
Example #3
0
 // Return true if this object is in collision with a VisibleObject bounded by
 // a specified radius.  Note that a VisibleObject's coordinates are defined
 // starting from the upper left corner of the object, so its bounding
 // radius must be added to both X and Y coordinates to obtain the centre
 // of the object.
 public bool IsTouching(VisibleObject other, int radius)
 {
     return(IsTouching(other.X, other.Y, other.BoundingRadius, radius));
 }
Example #4
0
 protected virtual void NotifyBumped(VisibleObject bumpedObject)
 {
 }
Example #5
0
 public virtual void NotifyCloseToObject(VisibleObject objectCloseBy)
 {
 }
Example #6
0
 protected override void NotifyBumped(VisibleObject bumpedObject)
 {
     Speed = 0;
     base.NotifyBumped(bumpedObject);
 }
Example #7
0
 private void DoNotifyBumped(VisibleObject touchingObject)
 {
     SendMessage(new MessageNotifyBumped(touchingObject));
     touchingObject.SendMessage(new MessageNotifyBumped(this));
 }