コード例 #1
0
ファイル: RectGameObject.cs プロジェクト: Yefimov/Game1.9
        public bool Intersect(RectGameObject that)
        {
            Rectangle a = new Rectangle((int)this.Position.X, (int)this.Position.Y, (int)this.Width, (int)this.Height);
            Rectangle b = new Rectangle((int)that.Position.X, (int)that.Position.Y, (int)that.Width, (int)that.Height);

            return(a.Intersects(b));
        }
コード例 #2
0
ファイル: RectGameObject.cs プロジェクト: Yefimov/Game1.9
 public bool Intersect(RectGameObject that)
 {
     Rectangle a = new Rectangle((int) this.Position.X, (int) this.Position.Y, (int) this.Width, (int) this.Height);
     Rectangle b = new Rectangle((int) that.Position.X, (int) that.Position.Y, (int) that.Width, (int) that.Height);
     return a.Intersects(b);       
 }