Пример #1
0
 public void AddAnimation(s_anim anima)
 {
     if (animations != null)
     {
         animations.Add(anima);
     }
     else
     {
         animations = new List <s_anim>();
         animations.Add(anima);
     }
 }
Пример #2
0
        public void SetAnimation(string animName, bool loop)
        {
            islooping = loop;
            s_anim an = animations.Find(x => x.name == animName);

            if (an != null)
            {
                if (lastAnimation != animName)
                {
                    currentAnimation   = an;
                    currentFrameNumber = 0;
                    currentFrame       = currentAnimation.animations[0];
                    animTimer          = currentAnimation.animations[0].Item2;
                    lastAnimation      = animName;
                }
            }
        }
Пример #3
0
        public ushort TileNum = 0;  //The tile that this block is under

        public o_block()
        {
            anima = new s_animhandler();
            s_anim animjump = new s_anim("spring_bounce");

            animjump.AddAnimation(0, 0.1f);
            animjump.AddAnimation(1, 0.1f);
            animjump.AddAnimation(2, 0.1f);
            animjump.AddAnimation(3, 0.1f);
            anima.AddAnimation(animjump);

            s_anim animidle = new s_anim("spring_idle");

            animidle.AddAnimation(3, 0.1f);
            animidle.AddAnimation(3, 0.1f);
            anima.AddAnimation(animidle);
            anima.currentFrameNumber = 3;

            s_anim animportal = new s_anim("portal");

            animportal.AddAnimation(0, 0.35f);
            animportal.AddAnimation(1, 0.35f);
            anima.AddAnimation(animportal);
        }
Пример #4
0
        public o_plcharacter()
        {
            isdebug = false;
            anima   = new s_animhandler();
            renderer.CentreOffset = new Point(-3, 0);

            s_anim animjump = new s_anim("jump");

            animjump.AddAnimation(2, 0.0f);
            animjump.AddAnimation(2, 0.0f);
            anima.AddAnimation(animjump);

            s_anim animidle = new s_anim("idle");

            animidle.AddAnimation(0, 0.4f);
            anima.AddAnimation(animidle);

            s_anim aniwalk = new s_anim("walk");

            aniwalk.AddAnimation(0, 0.07f);
            aniwalk.AddAnimation(0, 0.0f, s_anim.ANIM_TYPE.SOUND);
            aniwalk.AddAnimation(1, 0.07f);
            anima.AddAnimation(aniwalk);
        }