コード例 #1
0
ファイル: Animation.cs プロジェクト: lodossDev/gameengine
 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;
 }
コード例 #2
0
ファイル: Sprite.cs プロジェクト: lodossDev/gameengine
 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>();
 }
コード例 #3
0
ファイル: Sprite.cs プロジェクト: lodossDev/gameengine
 public Sprite(List<Texture2D> sprites, Animation.Type animationType = Animation.Type.REPEAT, int resetFrame = 1) : this(animationType)
 {
     AddTextures(sprites);
     SetResetFrame(resetFrame);
 }
コード例 #4
0
ファイル: Sprite.cs プロジェクト: lodossDev/gameengine
 public Sprite(Texture2D sprite, Animation.Type animationType = Animation.Type.REPEAT, int resetFrame = 1) : this(animationType)
 {
     AddTexture(sprite);
     SetResetFrame(resetFrame);
 }
コード例 #5
0
ファイル: Sprite.cs プロジェクト: lodossDev/gameengine
 public Sprite(string contentFolder, Animation.Type animationType = Animation.Type.REPEAT, int resetFrame = 1) : this(animationType)
 {
     AddTextures(contentFolder);
     SetResetFrame(resetFrame);
 }
コード例 #6
0
ファイル: Sprite.cs プロジェクト: lodossDev/gameengine
 public void SetAnimationType(Animation.Type animationType)
 {
     this.animationType = animationType;
 }
コード例 #7
0
ファイル: Animation.cs プロジェクト: lodossDev/gameengine
 public Link(Animation.State onState, Animation.State toState, int frameOnStart, bool onFrameComplete = true)
 {
     SetLink(onState, toState, frameOnStart, onFrameComplete);
 }
コード例 #8
0
ファイル: Player.cs プロジェクト: Minovsky/Go-Dough-
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        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);
        }
コード例 #9
0
ファイル: ComboAttack.cs プロジェクト: lodossDev/gameengine
 public Move(Animation.State state, float expireTime, int cancelFrame)
 {
     this.state = state;
     this.expireTime = expireTime;
     this.cancelFrame = cancelFrame - 1;
 }