Beispiel #1
0
		public bool CollidesWith(CollisionMask other) {
			if (CheckBoundingBoxCollision(other)) {
				other.CalculateBoundingBox();
				CalculateBoundingBox();
				bool a = false;
				bool b = false;
				for (int y = top; y < bottom; y++) {
					for (int x = left; x < right; x++) {
						a = data.GetPixel(x - left, y - top);
						b = other.data.GetPixel(x - other.left, y - other.top);
						if (a && b) {
							return true;
						}
					}
				}
			}
			return false;
		}
Beispiel #2
0
 public bool CheckBoundingBoxCollision(CollisionMask other)
 {
     return(rect.Intersects(other.GetBounds()) ||
            rect.Contains(other.GetBounds()));
 }
Beispiel #3
0
		public bool CheckBoundingBoxCollision(CollisionMask other) {
			return rect.Intersects(other.GetBounds())
					|| rect.Contains(other.GetBounds());
		}