Beispiel #1
0
        public void CollideWith(GameObject obj)
        {
            if (obj is Plane)
            {
                Plane plane = (Plane)obj;
                plane.Damage(Power);
                plane.AffectImpulse(Velocity * Mass, Position);
            }
            else if (obj is Bullet)
            {
                Bullet bullet = (Bullet)obj;
                bullet.IsGarbage = true;
            }
            else if (obj is Bonus)
            {
                ((Bonus)obj).Damage(Power);
            }

            IsGarbage = true;
        }