Beispiel #1
0
        public void Update()
        {
            Physics.UpdatePosition();
            if (countToDeath >= 0)
            {
                countToDeath++;
            }
            if (countToDeath == removeForFlipped)
            {
                BeRemoved = true;
            }
            switch (Health)
            {
            case KoopaHealth.Shelled:

                if (!(koopaSprite is ShelledKoopaSprite))
                {
                    koopaSprite = KoopaSpriteFactory.Instance.GetShelledSprite();
                }
                break;

            case KoopaHealth.Recovering:
                if (!(koopaSprite is RecoveringKoopaSprite))
                {
                    koopaSprite = KoopaSpriteFactory.Instance.GetRecoveringSprite();
                }
                break;

            case KoopaHealth.Normal:
                if (MovingLeft && !(koopaSprite is LeftMovingKoopaSprite))
                {
                    koopaSprite = KoopaSpriteFactory.Instance.GetLeftMovingSprite();
                }
                else if (!MovingLeft && !(koopaSprite is RightMovingKoopaSprite))
                {
                    koopaSprite = KoopaSpriteFactory.Instance.GetRightMovingSprite();
                }
                break;

            case KoopaHealth.Flipped:
                if (!(koopaSprite is FlippedKoopaSprite))
                {
                    koopaSprite = KoopaSpriteFactory.Instance.GetFlippedSprite();
                }
                break;
            }
            koopaSprite.Update();
        }
        public void Update()
        {
            Physics.UpdatePosition();

            if (RefreshSprite)
            {
                if (FacingLeft)
                {
                    bowserSprite = BowserSpriteFactory.Instance.GetLeftFacingSprite(MouthIsOpen);
                }
                else
                {
                    bowserSprite = BowserSpriteFactory.Instance.GetRightFacingSprite(MouthIsOpen);
                }

                RefreshSprite = false;
            }

            bowserSprite.Update();
        }
 public void Update()
 {
     Physics.UpdatePosition();
     piranaSprite.Update();
 }