예제 #1
0
파일: Boss.cs 프로젝트: sgdc/sgdc-old
        public override void LoadContent()
        {
            Texture = ContentManager.GetTexture("ForestBossIdle");

            Animation ani = new Animation(ContentManager.GetTexture("ForestBossAttack"), 2, 24, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("ForestBossAttack", ani);
            ani = new Animation(ContentManager.GetTexture("ForestBossIdle"), 1, 24, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("ForestBossIdle", ani);

            mAnimator.PlayAnimation("ForestBossIdle", false);

            base.LoadContent();
        }
예제 #2
0
파일: Animator.cs 프로젝트: sgdc/sgdc-old
        /*
         * bRestart : if true and animation is already playing, restart animation
         */
        public void PlayAnimation(String animation, bool bRestart)
        {
            if (!Animations.ContainsKey(animation) || (!bRestart && animation.Equals(CurrentAnimation)))
            {
                return;
            }

            mAni = Animations[animation];

            if (mCurrAnimation == null || mAni.Priority > mCurrAnimation.Priority
                || (mCurrAnimation.Priority % 10 == 0 && mCurrAnimation.Priority == mAni.Priority))
            {
                mCurrAnimation = mAni;
                CurrentAnimation = animation;
            }
        }
예제 #3
0
파일: PolarBear.cs 프로젝트: sgdc/sgdc-old
        public override void LoadContent()
        {
            //Texture = ContentManager.GetTexture("IceWalkingRight");

            Animation ani = new Animation(ContentManager.GetTexture("UrsoWalkingRight"), 2, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("NormalWalkRight", ani);

            ani = new Animation(ContentManager.GetTexture("UrsoWalkingRight"), 2, 8, 0, true, SpriteEffects.FlipHorizontally);
            mAnimator.Animations.Add("NormalWalkLeft", ani);

            ani = new Animation(ContentManager.GetTexture("UrsoWalkingFront"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("NormalWalkFront", ani);

            ani = new Animation(ContentManager.GetTexture("UrsoWalkingBack"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("NormalWalkBack", ani);

            ani = new Animation(ContentManager.GetTexture("IceWalkingRight"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("IceWalkRight", ani);

            ani = new Animation(ContentManager.GetTexture("IceWalkingRight"), 5, 8, 0, true, SpriteEffects.FlipHorizontally);
            mAnimator.Animations.Add("IceWalkLeft", ani);

            ani = new Animation(ContentManager.GetTexture("IceWalkingFront"), 4, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("IceWalkFront", ani);

            ani = new Animation(ContentManager.GetTexture("IceWalkingBack"), 4, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("IceWalkBack", ani);

            ani = new Animation(ContentManager.GetTexture("FireWalkingRight"), 4, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("FireWalkRight", ani);

            ani = new Animation(ContentManager.GetTexture("FireWalkingRight"), 4, 8, 0, true, SpriteEffects.FlipHorizontally);
            mAnimator.Animations.Add("FireWalkLeft", ani);

            ani = new Animation(ContentManager.GetTexture("FireWalkingFront"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("FireWalkFront", ani);

            ani = new Animation(ContentManager.GetTexture("FireWalkingBack"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("FireWalkBack", ani);

            bMoving = false;
            mAnimator.PlayAnimation("NormalWalkRight", false);

            base.LoadContent();

            CollisionBox = new Rectangle(CollisionBox.X, CollisionBox.Y, 25, 25);
        }
예제 #4
0
파일: Enemy.cs 프로젝트: sgdc/sgdc-old
        public override void LoadContent()
        {
            // good bears
            Animation ani = new Animation(ContentManager.GetTexture("BrownBearWalkRight"), 4, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("walkRight", ani);

            ani = new Animation(ContentManager.GetTexture("BrownBearWalkRight"), 4, 8, 0, true, SpriteEffects.FlipHorizontally);
            mAnimator.Animations.Add("walkLeft", ani);

            ani = new Animation(ContentManager.GetTexture("BrownBearWalkFront"), 4, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("walkFront", ani);

            ani = new Animation(ContentManager.GetTexture("BrownBearWalkBack"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("walkBack", ani);

            // evil bears
            ani = new Animation(ContentManager.GetTexture("WoodBearWalkRight"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("evilwalkRight", ani);

            ani = new Animation(ContentManager.GetTexture("WoodBearWalkRight"), 5, 8, 0, true, SpriteEffects.FlipHorizontally);
            mAnimator.Animations.Add("evilwalkLeft", ani);

            ani = new Animation(ContentManager.GetTexture("WoodBearWalkFront"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("evilwalkFront", ani);

            ani = new Animation(ContentManager.GetTexture("WoodBearWalkBack"), 5, 8, 0, true, SpriteEffects.None);
            mAnimator.Animations.Add("evilwalkBack", ani);

            base.LoadContent();

            if (CollisionBox.Width == 0 || CollisionBox.Height == 0)
            {
                CollisionBox = new Rectangle(CollisionBox.X, CollisionBox.Y, 40, 40);
            }
        }
예제 #5
0
파일: Animator.cs 프로젝트: sgdc/sgdc-old
 public Animator()
 {
     Animations = new Dictionary<string, Animation>();
     CurrentAnimation = null;
     mCurrAnimation = null;
 }