Пример #1
0
 public void Parar()
 {
     positionFinal = position;
     mSpriteCaminando = false;
     mSpriteParado = true;
     position = new Vector2();
     mAnimacion = null;
 }
Пример #2
0
        public void SetActualAnimation(string name)
        {
            if (name == null)
            {
                mAnimacion = null;
                return;
            }

            mAnimFinished = false;

            Animation anim = mAnimaciones[name];
            if (anim != null && anim != mAnimacion)
            {
                currentFrame.X = anim.frameInicial;
                currentFrame.Y = anim.fila;
                mAnimacion = anim;
                //Calculo esto por si tengo distintos tiempos de animaciones
                millisecondsPerFrame = (int) (1000.0f / mAnimacion.velocidad);
            }
        }
Пример #3
0
 public void AddAnimation(string name, int fila, int primerFrame, int numeroFrames, bool loop)
 {
     Animation anim = new Animation();
     anim.fila = fila;
     anim.frameInicial = primerFrame;
     anim.numeroFrames = numeroFrames;
     anim.Loop = loop;
     mAnimaciones[name] = anim;
 }