コード例 #1
0
ファイル: Pikmin.cs プロジェクト: rockyquinn/Pikmin-4
 /// <summary>
 /// Compares the positions of an object compared to this one
 /// </summary>
 /// <param name="o">object used for comparison</param>
 public new string compareTo(CollisionObject o)
 {
     if (this.getX() + this.getWidth() >= o.getX() &&
         this.getX() <= o.getX() + o.getWidth() &&
         this.getY() + this.getHeight() >= o.getY() &&
         this.getY() <= o.getY() + o.getHeight())
     {
         return "collision";
     }
     return "none";
 }
コード例 #2
0
 /// <summary>
 /// Compares the positions of an object compared to this one
 /// </summary>
 /// <param name="o">object used for comparison</param>
 public string compareTo(CollisionObject o)
 {
     if(this.x+this.width >= o.x &&
         this.x <= o.x+o.width &&
         this.y+this.height >= o.y &&
         this.y <= o.y+o.height)
     {
         return "collision";
     }
     return "none";
 }