Example #1
0
        public override void execute()
        {
            this.pBomb.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Bomb_Explosion));
            ExplosionEvent pExplosionEvent = new ExplosionEvent(this.pBomb);

            TimerMan.Add(TimeEvent.Name.ExplosionEvent, pExplosionEvent, 0.1f);
        }
Example #2
0
        public override void Notify()
        {
            GameObject pObject = this.pSubject.pObjB;

            Debug.Assert(pObject != null);

            GameSprite pUFOSplat = GameSpriteMan.Find(GameSprite.Name.UFOsplat);

            //future concept
            //pObject.GetProxy().SetRealSprite(this.pSprite);


            //get the locations and render the image
            pUFOSplat.PosX(pObject.x);
            pUFOSplat.PosY(pObject.y);
            pUFOSplat.Update();

            SpriteBatch pSB_Aliens = SpriteBatchMan.Find(SpriteBatch.Name.Aliens);


            pSB_Aliens.Attach(pUFOSplat);


            TimerMan.Add(TimeEvent.Name.SplatAnim, new SplatAnim(pUFOSplat, pSB_Aliens), 0.5f);
        }
        public override void Notify()
        {
            //when this notify is called we swap the images and draw it to the alien spritebatch
            //then maybe add a time event that..... removes it somehow... remove from spritebatch after a half second

            GameObject pObject = this.pSubject.pObjB;

            Debug.Assert(pObject != null);

            GameSprite pShipSplat = GameSpriteMan.Find(GameSprite.Name.ShipSplat);

            //future concept
            //pObject.GetProxy().SetRealSprite(this.pSprite);


            //get the locations and render the image
            //I'm really upset about this........ but here we are creating a new
            pShipSplat.PosX(pObject.x);
            pShipSplat.PosY(pObject.y);
            pShipSplat.Update();

            SpriteBatch pSB_Aliens = SpriteBatchMan.Find(SpriteBatch.Name.Aliens);

            pSB_Aliens.Attach(pShipSplat);

            TimerMan.Add(TimeEvent.Name.SplatAnim, new SplatAnim(pShipSplat, pSB_Aliens), 0.5f);
        }
Example #4
0
 public AnimationSprite(GameSprite.Name spriteName)
 {
     this.pSprite = GameSpriteMan.Find(spriteName);
     Debug.Assert(this.pSprite != null);
     this.pCurrImage  = null;
     this.poHeadImage = null;
 }
Example #5
0
        public void Set(GameSprite.Name name)
        {
            this.x = 0.0f;
            this.y = 0.0f;

            this.pSprite = GameSpriteMan.Find(name);
            Debug.Assert(this.pSprite != null);
        }
Example #6
0
        public AnimateCrab(Animation.Name animName, GameSprite.Name spriteName)
            : base(animName)
        {
            this.poFirstImage  = null;
            this.pCurrentImage = null;

            this.pSprite = GameSpriteMan.Find(spriteName);
            Debug.Assert(this.pSprite != null);
        }
Example #7
0
        //---------------------------------------------------------------------------------------------------------
        // Constructor
        //---------------------------------------------------------------------------------------------------------
        public AnimationSprite(GameSprite.Name name)
        {
            this.pGameSprite = GameSpriteMan.Find(name);
            Debug.Assert(this.pGameSprite != null);

            this.poFirstImage = null;
            this.pCurrImage   = null;
            this.poFirstSound = null;
            this.pCurrSound   = null;
        }
Example #8
0
 public void Set(GameSprite.Name name)
 {
     this.x       = 0.0f;
     this.y       = 0.0f;
     this.sx      = 1.0f;
     this.sy      = 1.0f;
     this.name    = ProxySprite.Name.Proxy;
     this.pSprite = GameSpriteMan.Find(name);
     Debug.Assert(this.pSprite != null);
 }
        public BlueAlienAnimationCommand(GameSprite.Name spriteName)
        {
            // initialized the sprite animation is attached to
            this.pSprite = GameSpriteMan.Find(spriteName);
            Debug.Assert(this.pSprite != null);

            // initialize references
            this.pCurrImage = null;

            // list
            this.poFirstImage = null;
        }
        public override void execute()
        {
            Ship pRealShip = (Ship)this.pShip;

            pRealShip.setState(ShipMan.State.End);
            pRealShip.setPositionState(ShipMan.State.Stay);
            pRealShip.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Ship_Explosion1));
            AnimationExplosion pAnimExplosion = new AnimationExplosion(pRealShip, 1.0f);

            pAnimExplosion.attach(Image.Name.Ship_Explosion2);
            pAnimExplosion.attach(Image.Name.Ship_Explosion1);
            TimerMan.Add(TimeEvent.Name.ExplosionEvent, pAnimExplosion, 0.3f);

            //this.pShip.remove();
        }
Example #11
0
        public override void execute()
        {
            //GameObject pA = (GameObject)this.pAlien;

            //GameObject pB = (GameObject)Iterator.GetParent(pA);
            //pA.remove();

            //if (checkParent(pB) == true)
            //{
            //    GameObject pC = (GameObject)Iterator.GetParent(pB);
            //    pB.remove();
            //}

            //pA.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Alien_Explosion));
            //GameObjectMan.Find(GameObject.Name.ExplosionGroup).add(pA);
            //SpriteBatchMan.Find(SpriteBatch.Name.Explosions).attach(pA.getProxySprite());
            //pA.activateCollisionSprite(SpriteBatchMan.Find(SpriteBatch.Name.Boxes));

            GameSprite pGameSprite = this.pAlien.getProxySprite().getGameSprite();
            Scene      pScene      = SceneMan.GetScene();

            if (pGameSprite.getName() == GameSprite.Name.Squid)
            {
                pScene.addScoreOne(30);
            }
            else if (pGameSprite.getName() == GameSprite.Name.Crab)
            {
                pScene.addScoreOne(20);
            }
            else if (pGameSprite.getName() == GameSprite.Name.Octopus)
            {
                pScene.addScoreOne(10);
            }

            FontMan.Find(Font.Name.ScoreOne).updateMessage(pScene.getScoreOne().ToString("D4"));

            if (pScene.getScoreOne() > pScene.getHighestScore())
            {
                pScene.setHighstScore(pScene.getScoreOne());
                FontMan.Find(Font.Name.HighestScore).updateMessage(pScene.getHighestScore().ToString("D4"));
            }

            this.pAlien.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Alien_Explosion));
            ExplosionEvent pExplosionEvent = new ExplosionEvent(this.pAlien);

            TimerMan.Add(TimeEvent.Name.ExplosionEvent, pExplosionEvent, 0.1f);
        }
        public override void execute(float deltaTime)
        {
            this.remainTime -= deltaTime;

            if (this.remainTime > 0)
            {
                // get next image
                ImageHolder pImageHolder = (ImageHolder)this.pCurrImage.pNext;

                // if at the end of the list, set first image back
                if (pImageHolder == null)
                {
                    pImageHolder = (ImageHolder)this.poFirstImage;
                }

                this.pCurrImage = pImageHolder;

                // change image
                this.pGameObject.getProxySprite().getGameSprite().swapImage(pImageHolder.getImage());

                // Add itself back to TimerMan
                TimerMan.Add(TimeEvent.Name.ExplosionEvent, this, deltaTime);
            }
            else
            {
                Ship pShip = (Ship)this.pGameObject;
                pShip.reduceLife();
                if (pShip.getLife() < 0)
                {
                    pShip.remove();
                    Scene pScene = SceneMan.GetScene();
                    pScene.unLoadContent();
                    pScene.setState(SceneMan.State.GameOverScene);
                    pScene.loadContent();
                }
                else
                {
                    pShip.setState(ShipMan.State.Ready);
                    pShip.setPositionState(ShipMan.State.Normal);
                    pShip.bMarkForDeath = false;
                    pShip.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Ship));
                }
            }
        }
        public override void execute()
        {
            //GameObject pA = (GameObject)this.pBrick;
            //GameObject pB = (GameObject)Iterator.GetParent(pA);

            //pA.remove();

            //// TODO: Need a better way...
            //if (checkParent(pB) == true)
            //{
            //    GameObject pC = (GameObject)Iterator.GetParent(pB);
            //    pB.remove();

            //    if (checkParent(pC) == true)
            //    {
            //        pC.remove();
            //    }
            //}
            this.pBrick.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.Missile_Explosion));
            ExplosionEvent pExplosionEvent = new ExplosionEvent(this.pBrick);

            TimerMan.Add(TimeEvent.Name.ExplosionEvent, pExplosionEvent, 0.1f);
        }
        public override void execute()
        {
            Scene pScene = SceneMan.GetScene();

            pScene.addScoreOne(200);

            FontMan.Find(Font.Name.ScoreOne).updateMessage(pScene.getScoreOne().ToString("D4"));

            if (pScene.getScoreOne() > pScene.getHighestScore())
            {
                pScene.setHighstScore(pScene.getScoreOne());
                FontMan.Find(Font.Name.HighestScore).updateMessage(pScene.getHighestScore().ToString("D4"));
            }

            this.pUFO.getProxySprite().setGameSprite(GameSpriteMan.Find(GameSprite.Name.UFO_Explosion));
            ExplosionEvent pExplosionEvent = new ExplosionEvent(this.pUFO);

            TimerMan.Add(TimeEvent.Name.ExplosionEvent, pExplosionEvent, 0.1f);

            UFOEvent pUFOEvent = new UFOEvent();

            TimerMan.Add(TimeEvent.Name.MovementAnimation, pUFOEvent, UFOMan.getDeltaTime());
        }
Example #15
0
 public void Set(GameSprite.Name name)
 {
     // Go find it
     this.pSpriteBase = GameSpriteMan.Find(name);
     Debug.Assert(this.pSpriteBase != null);
 }
Example #16
0
 public void Initialize(GameSprite.Name name)
 {
     pSpriteBase = GameSpriteMan.Find(name);
 }