Example #1
0
        public override void VisitWallRight(WallRight r)
        {
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(r, this);
            pColPair.NotifyListeners();
        }
Example #2
0
        public override void Visit(BombLeaf b)
        {
            CollisionPair pair = ColPairMan.Find(CollisionPairName.Bomb_Shield);

            pair.SetCollision(b, this);
            pair.Notify();
        }
Example #3
0
        static public ColPair GetActiveColPair()
        {
            // get the singleton
            ColPairMan pMan = ColPairMan.privGetInstance();

            return(pMan.pActiveColPair);
        }
        public override void VisitMissile(Missile m)
        {
            // Missile vs Column
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(m, this);
        }
        public override void VisitGroup(AlienGrid a)
        {
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(a, this);
            pColPair.NotifyListeners();
        }
Example #6
0
        public override void VisitBomb(Bomb b)
        {
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(b, this);
            pColPair.NotifyListeners();
        }
Example #7
0
        public override void VisitShip(Ship s)
        {
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(s, this);
            pColPair.NotifyListeners();
        }
Example #8
0
        override public void Execute(float deltaTime)
        {
            float value = pRandom.Next(10, 60);
            UFO   pUFO  = new UFO(GameObject.Name.UFO, GameSprite.Name.UFO, 100, 515);

            ColPair pColPair = ColPairMan.Add(ColPair.Name.UFO_WallLeft, pUFO, this.pWallLeft);

            pColPair.Attach(new UFOWallLeftObserver());

            pColPair = ColPairMan.Add(ColPair.Name.UFO_WallRight, pUFO, this.pWallRight);
            pColPair.Attach(new UFOWallRightObserver());

            MissileGroup pMissile = (MissileGroup)GameObjectMan.Find(GameObject.Name.MissileGroup);

            pColPair = ColPairMan.Add(ColPair.Name.UFOMissile, pUFO, pMissile);
            pColPair.Attach(new RemoveUFOObserver());

            pUFO.ActivateCollisionSprite(this.pSB_Boxes);
            pUFO.ActivateGameSprite(this.pSB_Aliens);
            GameObjectMan.Attach(pUFO);

            Sound.Name pSoundName = Sound.Name.Uninitialized;
            switch (pRandom.Next(0, 1))
            {
            case (0):
                pSoundName = Sound.Name.UFOLow;
                break;

            case (1):
                pSoundName = Sound.Name.UFOHigh;
                break;
            }
            SoundMan.PlaySound(pSoundName);
            TimerMan.Add(TimeEvent.Name.UFO, this, value);
        }
Example #9
0
 // public
 public static void Create(int init = 2, int delta = 2)
 {
     if (pMan == null)
     {
         pMan = new ColPairMan(init, delta);
     }
 }
        public override void VisitOctopus(Octopus a)
        {
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(this, a);
            pColPair.NotifyListeners();
        }
Example #11
0
        public override void Visit(UFOLeaf a)
        {
            CollisionPair pair = ColPairMan.Find(CollisionPairName.UFO_Wall);

            pair.SetCollision(this, a);
            pair.Notify();
        }
Example #12
0
        public override void Visit(BombLeaf a)
        {
            CollisionPair pair = ColPairMan.Find(CollisionPairName.Bomb_Wall);

            pair.SetCollision(a, this);
            pair.Notify();
        }
Example #13
0
        public override void VisitBomb(Bomb u)
        {
            ColPair cp = ColPairMan.GetActiveColPair();

            cp.SetCollision(u, this);
            cp.NotifyListeners();
        }
Example #14
0
        public override void VisitMissile(Missile m)
        {
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(m, this);
            pColPair.NotifyListeners();
        }
Example #15
0
        override public void Update(float systemTime)
        {
            // Snd update - keeps everything moving and updating smoothly
            sndEngine.Update();

            // Single Step, Free running...
            Simulation.Update(systemTime);

            // Input
            InputMan.Update();

            // Run based on simulation stepping
            if (Simulation.GetTimeStep() > 0.0f)
            {
                // Fire off the timer events
                TimerMan.Update(Simulation.GetTotalTime());

                // walk through all objects and push to flyweight
                GameObjectMan.Update();

                // Do the collision checks
                ColPairMan.Process();

                // Delete any objects here...
                DelayedObjectMan.Process();
            }
        }
Example #16
0
 public override void VisitMissile(Missile m)
 {
     // Missile vs WallTop
     //Debug.WriteLine(" ---> Done");
     ColPair pColPair = ColPairMan.GetActiveColPair();
     pColPair.SetCollision(m, this);
     pColPair.NotifyListeners();
 }
Example #17
0
        public override void VisitGroup(AlienGroup a)
        {
            //Aliens Got to the bottom Game Over
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(a, this);
            pColPair.NotifyListeners();
        }
Example #18
0
        public static void Dump()
        {
            ColPairMan pMan = ColPairMan.privGetInstance();

            Debug.Assert(pMan != null);

            pMan.baseDump();
        }
Example #19
0
        public override void Visit(ShipBulletLeaf a)
        {
            //Bullet Hit WallLeaf ---> reset
            CollisionPair pair = ColPairMan.Find(CollisionPairName.Bullet_Wall);

            pair.SetCollision(a, this);
            pair.Notify();
        }
Example #20
0
        // Collision
        public override void Visit(AliensCol a)
        {
            // Alien Col hit Wall -> change direction
            CollisionPair pair = ColPairMan.Find(CollisionPairName.Alien_Wall);

            pair.Notify();
            Nums.AlienDeltaX *= -1;
        }
Example #21
0
        // Alien Hit Shield
        public override void Visit(AliensCol b)
        {
            // Alien Hit Shield Brick --> visit children of Aliens
            CollisionPair pair = ColPairMan.Find(CollisionPairName.Alien_Shield);

            pair.SetCollision(b, this);
            pair.Notify();
        }
Example #22
0
        static public ColPair GetActiveColPair()
        {
            ColPairMan pMan = ColPairMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            return(pMan.pActiveColPair);
        }
Example #23
0
        public override void Visit(ShipBulletLeaf b)
        {
            //Bullet hit Bullet --> Do Something
            CollisionPair pair = ColPairMan.Find(CollisionPairName.Bullet_Bomb);

            pair.SetCollision(b, this);
            pair.Notify();
        }
Example #24
0
        public override void Visit(BombLeaf b)
        {
            // Bombleaf Hit Shipleaf ->Do Something
            CollisionPair pair = ColPairMan.Find(CollisionPairName.Bomb_Ship);

            pair.SetCollision(b, this);
            pair.Notify();
        }
Example #25
0
        public override void VisitBomb(Bomb b)
        {
            //Debug.WriteLine(" ---> Done");
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(b, this);
            pColPair.NotifyListeners();
        }
Example #26
0
        private void Hit(GameObject a, GameObject b)
        {
            Debug.WriteLine("Alien Hit by Missle");
            ColPair pPair = ColPairMan.GetActivePair();

            pPair.SetCollision(a, b);
            pPair.NotifyObservers();
        }
Example #27
0
 private static ColPairMan GetInstance(int t = 4, int d = 1)
 {
     if (_ColMan == null)
     {
         _ColMan = new ColPairMan(t, d);
     }
     return(_ColMan);
 }
Example #28
0
        public override void VisitAlien(AlienCategory a)
        {
            //Alien v Shield Brick
            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(a, this);
            pColPair.NotifyListeners();
        }
Example #29
0
        public static void Remove(ColPair pNode)
        {
            ColPairMan pMan = ColPairMan.privGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pNode != null);
            pMan.baseRemove(pNode);
        }
        public override void VisitWallGroup(WallGroup w)
        {
            Debug.Assert(w != null);

            ColPair pColPair = ColPairMan.GetActiveColPair();

            pColPair.SetCollision(w, this);
            pColPair.NotifyListeners();
        }