コード例 #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");
 }
コード例 #6
0
        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
ファイル: AnimationSprite.cs プロジェクト: ccaunca/Projects
        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
ファイル: ShieldList.cs プロジェクト: mmurph83/SpaceInvaders
        public void checkAlienCollision(GameObjectTree tree)
        {
            SLink temp = head;

            while (temp != null)
            {
                ((ShieldDataNode)temp).getShield().checkGameObjectTreeCollision(tree);
                temp = temp.next;
            }
        }
コード例 #19
0
ファイル: ShieldList.cs プロジェクト: mmurph83/SpaceInvaders
        public void setAllActive(Status s)
        {
            SLink temp = head;

            while (temp != null)
            {
                ((ShieldDataNode)temp).getShield().setAllActive(s);
                temp = temp.next;
            }
        }
コード例 #20
0
ファイル: ShieldList.cs プロジェクト: mmurph83/SpaceInvaders
        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
ファイル: ShieldList.cs プロジェクト: mmurph83/SpaceInvaders
        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
ファイル: ShieldList.cs プロジェクト: mmurph83/SpaceInvaders
 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
ファイル: SLink.cs プロジェクト: wangjo22/Final
        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;
        }
コード例 #28
0
        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
ファイル: AnimationSprite.cs プロジェクト: ccaunca/Projects
        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;
            }
        }