Пример #1
0
        public override void Execute(float deltaTime, bool repeat)
        {
            ImageHolder pImageHolder = (ImageHolder)SLink.GetNext(this.pCurrImage);

            if (pImageHolder == null)
            {
                pImageHolder = (ImageHolder)poHeadImage;
            }

            this.pCurrImage = pImageHolder;

            this.pSprite.SwapImage(pImageHolder.GetpImange());

            if (repeat == true)
            {
                if (pSprite.name == GameSprite.Name.Squid)
                {
                    TimerMan.Add(TimerEvent.Name.SquidAnimation, this, deltaTime);
                }
                else if (pSprite.name == GameSprite.Name.Crab)
                {
                    TimerMan.Add(TimerEvent.Name.CrabAnimation, this, deltaTime);
                }
                else if (pSprite.name == GameSprite.Name.Octopus)
                {
                    TimerMan.Add(TimerEvent.Name.OctopusAnimation, this, deltaTime);
                }
                else if (pSprite.name == GameSprite.Name.ShipDies)
                {
                    TimerMan.Add(TimerEvent.Name.AnimShip, this, deltaTime);
                }
            }
        }
Пример #2
0
 public void PrintReport()
 {
     Debug.WriteLine("[Animation Sprite: " + pSprite.name + " ]");
     Debug.Write("Image List: ");
     SLink.PrintList(poFirstImage);
     Debug.WriteLine("\n");
 }
Пример #3
0
 public void PrintReport()
 {
     Debug.WriteLine("[Composite Motion: ");
     Debug.Write("Motion List: ");
     SLink.PrintList(poFirstMotion);
     Debug.WriteLine(" ]\n");
 }
Пример #4
0
 public AnimationSprite(GameSprite.Name spriteName)
 {
     this.pSprite = GameSpriteMan.Find(spriteName);
     Debug.Assert(this.pSprite != null);
     this.pCurrImage  = null;
     this.poHeadImage = null;
 }
Пример #5
0
 public void PrintReport()
 {
     Debug.WriteLine("[ TimedSoundEffects ]");
     Debug.Write("Sound List: ");
     SLink.PrintList(poFirstSound);
     Debug.WriteLine("\n");
 }
        public static Player add(Player.PlayerType playerName)
        {
            Player player = new Player(playerName, 0, 3);

            SLink.addToFront(ref playerList, player);
            return(player);
        }
Пример #7
0
 public void Destroy()
 {
     pCurrImage = null;
     pSprite    = null;
     ClearImageList(pFirstImage);
     pFirstImage = null;
 }
Пример #8
0
 public MovementSprite(Composite pGrid)
 {
     this.pSprites = pGrid;
     Debug.Assert(this.pSprites != null);
     this.poHead = null;
     this.pCurr  = null;
 }
Пример #9
0
        public override void execute(float currentTime)
        {
            ImageHolder imageHolder = this.pCurrImage.pNext == null ? (ImageHolder)this.pFirstImage : (ImageHolder)this.pCurrImage.pNext;

            this.pCurrImage = imageHolder;
            this.pSprite.SwapImage(imageHolder.pImage);
        }
Пример #10
0
        public AlienImageAnimation(Sprite.SpriteName spriteGameName)
        {
            cSpriteGame = (Sprite)SpriteManager.find(spriteGameName);
            Debug.Assert(cSpriteGame != null);

            cCurrImg = null;
            cImgList = null;
        }
Пример #11
0
        public SpriteAnimation(SpriteAnimation.Name animationName, Sprite.Name spriteName)
        {
            // list
            this.pFirstImage = null;
            this.pCurrImage  = null;

            Set(animationName, spriteName);
        }
Пример #12
0
 public SpriteAnimation()
     : base()
 {
     this.name        = SpriteAnimation.Name.Uninitialized;
     this.pSprite     = null;
     this.pFirstImage = null;
     this.pCurrImage  = null;
 }
Пример #13
0
        public AnimationSprite(Sprite.Name name)
        {
            this.pSprite = SpriteManager.Find(name);
            Debug.Assert(this.pSprite != null);

            // initialize references
            this.pCurrentImage = null;
            this.poFirstImage  = null;
        }
Пример #14
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);
        }
Пример #15
0
        public void Attach(float x, float y, SndObserver pSn)
        {
            PositionHoder pPositionHoder = null;

            pPositionHoder = new PositionHoder(x, y, pSn);
            Debug.Assert(pPositionHoder != null);

            SLink.AddToFront(ref this.poHead, pPositionHoder);
            this.pCurr = pPositionHoder;
        }
Пример #16
0
        override public void UpdateRange(int delta)
        {
            PositionHoder pPositionHoder = (PositionHoder)poHead;

            while (pPositionHoder != null)
            {
                pPositionHoder.SetPositionX(pPositionHoder.GetPositionX() + delta);
                pPositionHoder = (PositionHoder)SLink.GetNext(pPositionHoder);
            }
        }
Пример #17
0
        public static void PrintList(SLink pHead)
        {
            SLink tmpNode = pHead;

            while (tmpNode != null)
            {
                Debug.Write(tmpNode + " , ");
                tmpNode = tmpNode.pNext;
            }
        }
Пример #18
0
        public void checkAlienCollision(GameObjectTree tree)
        {
            SLink temp = head;

            while (temp != null)
            {
                ((ShieldDataNode)temp).getShield().checkGameObjectTreeCollision(tree);
                temp = temp.next;
            }
        }
Пример #19
0
        public void setAllActive(Status s)
        {
            SLink temp = head;

            while (temp != null)
            {
                ((ShieldDataNode)temp).getShield().setAllActive(s);
                temp = temp.next;
            }
        }
Пример #20
0
        public void checkProjectileCollision(ProjectileManager manager)
        {
            SLink temp = head;

            while (temp != null)
            {
                manager.sendProjectiles(((ShieldDataNode)temp).getShield());
                temp = temp.next;
            }
        }
Пример #21
0
        public void Attach(Image.Name imageName)
        {
            Image pImage = ImageMan.Find(imageName);

            Debug.Assert(pImage != null);
            ImageHolder pImageHolder = new ImageHolder(pImage);

            Debug.Assert(pImageHolder != null);

            SLink.AddToFront(ref this.poHeadImage, pImageHolder);
            this.pCurrImage = pImageHolder;
        }
Пример #22
0
        public AnimationSprite(GameSprite.Name spriteName)
        {
            // initialized the sprite animation is attached to
            this.pSprite = GameSpriteManager.Find(spriteName);
            Debug.Assert(this.pSprite != null);

            // initialize references
            this.pCurrImage = null;

            // list
            this.poFirstImage = null;
        }
Пример #23
0
        public void setPos(float x, float y, float Xoffset, float Yoffset, int i)
        {
            SLink temp = head;

            while (temp != null && ((ShieldDataNode)temp).getNum() != i)
            {
                temp = temp.next;
            }
            if (temp != null)
            {
                ((ShieldDataNode)temp).getShield().setPos(x, y, Xoffset, Yoffset);
            }
        }
Пример #24
0
 public ShieldList(int totalShields)
 {
     if (totalShields > 0)
     {
         head = new ShieldDataNode(GameObjectTreeFactory.getFactory.makeGameObjectTreeShield(), 0);
     }
     for (int i = 1; i < totalShields; i++)
     {
         SLink temp = new ShieldDataNode(GameObjectTreeFactory.getFactory.makeGameObjectTreeShield(), i);
         temp.next = head;
         head      = temp;
     }
 }
Пример #25
0
        public void Attach(Sound.Name soundName)
        {
            // Create a new holder
            SoundNameHolder pSoundHolder = new SoundNameHolder(soundName);

            Debug.Assert(pSoundHolder != null);

            // Attach it to the TimedSoundEffect ( Push to front )
            SLink.AddToFront(ref this.poFirstSound, pSoundHolder);

            // Set the first one to this Sound
            this.pCurrentSound = pSoundHolder;
        }
Пример #26
0
        public static SLink PullFromFront(ref SLink pHead)
        {
            Debug.Assert(pHead != null);

            // Return node
            SLink pNode = pHead;

            // Update head
            pHead = pHead.pNext;
            pNode.Clear();

            return(pNode);
        }
Пример #27
0
        public void attach(String pSound)
        {
            // create a new ImageHolder to hold the image
            SoundHolder pSoundHolder = new SoundHolder(pSound);

            Debug.Assert(pSoundHolder != null);

            // add to front
            SLink.AddToFront(ref this.poFirstSound, pSoundHolder);

            // set the first one to this image
            this.pCurrSound = pSoundHolder;
        }
        public void Attach(Sound.Name soundName)
        {
            Sound pSound = SoundMan.Find(soundName);

            Debug.Assert(pSound != null);

            SoundHolder pSoundHolder = new SoundHolder(pSound);

            Debug.Assert(pSoundHolder != null);

            SLink.AddToFront(ref this.poFirstSound, pSoundHolder);

            this.pCurrSound = pSoundHolder;
        }
Пример #29
0
        //Attaches the Image Holder to the front of the list and current image is updated with it.
        public void attachImg(Image.ImageName imageName)
        {
            Image image = (Image)ImageManager.find(imageName);

            Debug.Assert(image != null);

            ImageHolder imageHolder = new ImageHolder(image);

            Debug.Assert(imageHolder != null);

            SLink.addToFront(ref cImgList, imageHolder);

            cCurrImg = imageHolder;
        }
Пример #30
0
        public void Dump()
        {
            Debug.Assert(this.pFirstImage != null);
            Debug.WriteLine(String.Format("AnimationSprite:{0}({1})", this.pSprite.name.ToString(), this.GetHashCode()));
            Debug.WriteLine(String.Format("CurrentImage:{0}", this.pCurrImage.ToString()));
            Debug.WriteLine("Images:");
            SLink curr = pFirstImage;

            while (curr != null)
            {
                ImageHolder imageHolder = (ImageHolder)curr;
                Debug.WriteLine("\t\t{0}({1})", imageHolder.pImage.name.ToString(), imageHolder.pImage.GetHashCode());
                curr = curr.pNext;
            }
        }