Пример #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
        override public void UpdateRange(int delta)
        {
            PositionHoder pPositionHoder = (PositionHoder)poHead;

            while (pPositionHoder != null)
            {
                pPositionHoder.SetPositionX(pPositionHoder.GetPositionX() + delta);
                pPositionHoder = (PositionHoder)SLink.GetNext(pPositionHoder);
            }
        }
Пример #3
0
        public override void Execute(float deltaTime, bool repeat)
        {
            PositionHoder pPositionHoder = (PositionHoder)SLink.GetNext(this.pCurr);

            if (pPositionHoder == null)
            {
                pPositionHoder = (PositionHoder)poHead;
            }

            this.pCurr = pPositionHoder;

            this.pSprites.Move(pPositionHoder.GetPositionX(), pPositionHoder.GetPositionY());
            pPositionHoder.GetSnd().Notify();

            TimerMan.Add(TimerEvent.Name.AlienMovement, this, deltaTime);
        }
Пример #4
0
        private void ClearImageList(SLink listHead)
        {
            SLink pNode;
            SLink pTmpNode;

            pNode = listHead;
            while (pNode != null)
            {
                // Walk through the list
                pTmpNode = pNode;
                pNode    = pNode.GetNext();

                // Clear and remove node
                Debug.Assert(pTmpNode != null);
                DestroyImageRef((ImageRef)pTmpNode);
                pTmpNode = null;
            }
        }