Server.Bullet.checkCollision C# (CSharp) Méthode

checkCollision() public méthode

Check the collision between the bullet and a GameObject instance
public checkCollision ( GameObject object2 ) : bool
object2 GameObject An instance to a GameObject
Résultat bool
        public bool checkCollision(GameObject object2)
        {
            if (this == object2) return false;
            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;
        }