Ejemplo n.º 1
0
 public void SetLink(Animation.State onState, Animation.State toState, int frameOnStart, bool onFrameComplete = true)
 {
     this.onState = onState;
     this.toState = toState;
     this.onFrameState = (frameOnStart - 1);
     this.onFrameComplete = onFrameComplete;
 }
Ejemplo n.º 2
0
 public Sprite(Animation.Type animationType = Animation.Type.REPEAT)
 {
     currentFrame = 0;
     sprites = new List<Texture2D>();
     frameDelays = new List<float>();
     offsets = new List<Vector2>();
     frameTimeElapsed = 0.0f;
     totalTimeRemaining = 0.0f;
     resetFrame = 0;
     boxes = new Dictionary<int, List<CLNS.BoundingBox>>();
     spriteOffset = Vector2.Zero;
     position = Vector2.Zero;
     this.animationType = animationType;
     effects = SpriteEffects.None;
     isAnimationComplete = false;
     isFrameComplete = new List<bool>();
 }
Ejemplo n.º 3
0
 public Sprite(List<Texture2D> sprites, Animation.Type animationType = Animation.Type.REPEAT, int resetFrame = 1) : this(animationType)
 {
     AddTextures(sprites);
     SetResetFrame(resetFrame);
 }
Ejemplo n.º 4
0
 public Sprite(Texture2D sprite, Animation.Type animationType = Animation.Type.REPEAT, int resetFrame = 1) : this(animationType)
 {
     AddTexture(sprite);
     SetResetFrame(resetFrame);
 }
Ejemplo n.º 5
0
 public Sprite(string contentFolder, Animation.Type animationType = Animation.Type.REPEAT, int resetFrame = 1) : this(animationType)
 {
     AddTextures(contentFolder);
     SetResetFrame(resetFrame);
 }
Ejemplo n.º 6
0
 public void SetAnimationType(Animation.Type animationType)
 {
     this.animationType = animationType;
 }
Ejemplo n.º 7
0
 public Link(Animation.State onState, Animation.State toState, int frameOnStart, bool onFrameComplete = true)
 {
     SetLink(onState, toState, frameOnStart, onFrameComplete);
 }
Ejemplo n.º 8
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        void loadAnimationSet()
        {
            animationSet = new Dictionary<string, Animation>();

            Animation animation = new Animation();
            Texture2D playerTexture = level.content.Load<Texture2D>("Graphics\\c");
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 4, FRAMETIME, Color.White, scale, true, -1, false);
            animationSet.Add("walk", animation);

            animation = new Animation();
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 1, FRAMETIME, Color.White, scale, true, 0, false);
            animationSet.Add("char", animation);

            animation = new Animation();
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 1, FRAMETIME, Color.White, scale, true, 2, false);
            animationSet.Add("jump", animation);

            animation = new Animation();
            playerTexture = level.content.Load<Texture2D>("Graphics\\c-ball");
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 5, FRAMETIME, Color.White, scale, false, -1, false);
            animationSet.Add("c2b", animation);

            animation = new Animation();
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 5, FRAMETIME, Color.White, scale, false, -1, true);
            animationSet.Add("b2c", animation);

            animation = new Animation();
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 1, FRAMETIME, Color.White, scale, true, 4, false);
            animationSet.Add("ball", animation);

            animation = new Animation();
            playerTexture = level.content.Load<Texture2D>("Graphics\\c-s");
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 5, FRAMETIME, Color.White, scale, false, -1, false);
            animationSet.Add("c2s", animation);

            animation = new Animation();
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 5, FRAMETIME, Color.White, scale, false, -1, true);
            animationSet.Add("s2c", animation);

            animation = new Animation();
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 1, FRAMETIME, Color.White, scale, true, 4, false);
            animationSet.Add("square", animation);

            animation = new Animation();
            playerTexture = level.content.Load<Texture2D>("Graphics\\b-s");
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 1, FRAMETIME, Color.White, scale, false, -1, false);
            animationSet.Add("b2s", animation);

            animation = new Animation();
            animation.Initialize(playerTexture, Vector2.Zero, frameWidth, frameHeight, 1, FRAMETIME, Color.White, scale, false, -1, true);
            animationSet.Add("s2b", animation);
        }
Ejemplo n.º 9
0
 public Move(Animation.State state, float expireTime, int cancelFrame)
 {
     this.state = state;
     this.expireTime = expireTime;
     this.cancelFrame = cancelFrame - 1;
 }