Ejemplo n.º 1
0
        public override void Init(GameState s, GameplayController c, object args)
        {
            state = s;

            initArgs = args == null ? null : args as AnimationInitArgs;
            if (initArgs == null)
            {
                initArgs = AnimationInitArgs.Default;
            }

            alRest                   = new AnimationLoop(initArgs.Splices[0].X, initArgs.Splices[0].Y);
            alRest.FrameSpeed        = initArgs.Speeds[0];
            alWalk                   = new AnimationLoop(initArgs.Splices[1].X, initArgs.Splices[1].Y);
            alWalk.FrameSpeed        = initArgs.Speeds[1];
            alMelee                  = new AnimationLoop(initArgs.Splices[2].X, initArgs.Splices[2].Y);
            alMelee.FrameSpeed       = initArgs.Speeds[2];
            alPrepareFire            = new AnimationLoop(initArgs.Splices[3].X, initArgs.Splices[3].Y);
            alPrepareFire.FrameSpeed = initArgs.Speeds[3];
            alFire                   = new AnimationLoop(initArgs.Splices[4].X, initArgs.Splices[4].Y);
            alFire.FrameSpeed        = initArgs.Speeds[4];
            alDeath                  = new AnimationLoop(initArgs.Splices[5].X, initArgs.Splices[5].Y);
            alDeath.FrameSpeed       = initArgs.Speeds[5];
            SetAnimation(BehaviorFSM.None);

            System.Threading.Interlocked.Exchange(ref isInit, 1);
        }
Ejemplo n.º 2
0
        public override void Init(GameState s, GameplayController c, object args)
        {
            state = s;

            initArgs = args == null ? null : args as AnimationInitArgs;
            if(initArgs == null) initArgs = AnimationInitArgs.Default;

            alRest = new AnimationLoop(initArgs.Splices[0].X, initArgs.Splices[0].Y);
            alRest.FrameSpeed = initArgs.Speeds[0];
            alWalk = new AnimationLoop(initArgs.Splices[1].X, initArgs.Splices[1].Y);
            alWalk.FrameSpeed = initArgs.Speeds[1];
            alMelee = new AnimationLoop(initArgs.Splices[2].X, initArgs.Splices[2].Y);
            alMelee.FrameSpeed = initArgs.Speeds[2];
            alPrepareFire = new AnimationLoop(initArgs.Splices[3].X, initArgs.Splices[3].Y);
            alPrepareFire.FrameSpeed = initArgs.Speeds[3];
            alFire = new AnimationLoop(initArgs.Splices[4].X, initArgs.Splices[4].Y);
            alFire.FrameSpeed = initArgs.Speeds[4];
            alDeath = new AnimationLoop(initArgs.Splices[5].X, initArgs.Splices[5].Y);
            alDeath.FrameSpeed = initArgs.Speeds[5];
            SetAnimation(BehaviorFSM.None);

            System.Threading.Interlocked.Exchange(ref isInit, 1);
        }