Пример #1
0
        public override void VisitMissile(Missile m)
        {
            ScoreManager.AddScoreToPlayer1(20);
            CollisionPair pColPair = CollisionPairManager.GetCurrentCollisionPair();

            pColPair.SetObserverSubject(m, this);
            pColPair.NotifyListeners();
        }
Пример #2
0
        public override bool IsValidCollision()
        {
            bool isValid = false;

            this.isMissileHit = false;

            if (this.pSubject.pObjA is UFOGroup && this.pSubject.pObjB is WallRight)
            {
                isValid = true;
            }
            else if (this.pSubject.pObjA is UFOGroup && this.pSubject.pObjB is WallLeft)
            {
                isValid = true;
            }
            else if (this.pSubject.pObjA is UFOGroup && this.pSubject.pObjB is MissileGroup)
            {
                ScoreManager.AddScoreToPlayer1(200);
                this.isMissileHit = true;
                isValid           = true;
            }
            this.pUFO = Iterator.GetChildGameObject(this.pSubject.pObjA);
            return(isValid);
        }