public bool CheckCollision(PhysicalObject other) { Rectangle myRect = new Rectangle(Convert.ToInt32(X), Convert.ToInt32(Y), Convert.ToInt32(Width), Convert.ToInt32(Height)); Rectangle otherRect = new Rectangle(Convert.ToInt32(other.X), Convert.ToInt32(other.Y), Convert.ToInt32(other.X), Convert.ToInt32(other.Width)); return(myRect.Intersects(otherRect)); }
// kollision checkning mellan objekt public bool checkCollision(PhysicalObject other) { Rectangle myRect = new Rectangle(Convert.ToInt32(X); }