SpaceShip.Logic.GameObject.checkCollision C# (CSharp) 메소드

checkCollision() 공개 메소드

public checkCollision ( GameObject object2 ) : bool
object2 GameObject
리턴 bool
        public bool checkCollision(GameObject object2)
        {
            float distance = (float)(Math.Sqrt(Math.Pow((this.x - object2.x), 2) + Math.Pow(this.y - object2.y, 2)));
            if (distance < this.radius + object2.radius) return true;
            return false;
        }