Ejemplo n.º 1
0
 protected override void LoadAnimations()
 {
     //these are wrong, figure out a nice parameterizable way to avoid a lot of anim duplication?
     int[] timings = TimingSequence(8, frameCount);
     animations["default"] =
         new Animation(FrameSequence(0, 1), timings, false);
     animations["run"] =
         new Animation(FrameSequence(0, 1), timings, false);
     animations["jet"] =
         new Animation(FrameSequence(1, 1), timings, false);
     animations["begin-jet"] =
         new Animation(FrameSequence(1, 1), timings, false);
     animations["stop-jet"] =
         new Animation(FrameSequence(1, 1), timings, false);
     animations["jump"] =
         new Animation(FrameSequence(0, 2), timings, false);
     animations["fall"] =
         new Animation(FrameSequence(1, 1), timings, false);
     animations["land"] =
         new Animation(FrameSequence(0, 1), timings, false);
     animations["run"] =
         new Animation(FrameSequence(0, 1), timings, false);
 }
Ejemplo n.º 2
0
 public override void LoadContent()
 {
     base.LoadContent();
     int[] frames = new int[FrameCount];
     int[] timings = new int[FrameCount];
     for (int i = 0; i < frames.Length; i++)
     {
         frames[i] = i;
         timings[i] = 10;
     }
     animations["default"] = new Animation(frames, timings, true);
     spriteWidth = spriteSheet.Width / FrameCount;
     bounds.Width = spriteWidth;
     bounds.Height = spriteSheet.Height;
     visualWidth = spriteWidth;
 }
Ejemplo n.º 3
0
        public override void LoadContent()
        {
            int[] timings = TimingSequence(5, 2);
            animations["default"] =
                new Animation(FrameSequence(0, 2), timings, true);
            animations["death"] =
                new Animation(FrameSequence(8, 1), TimingSequence(1,1), false);
            animations["run"] =
                new Animation(FrameSequence(0, 2), timings, true);
            animations["run-attacking"] =
                new Animation(FrameSequence(4, 2), timings, true);
            animations["jet"] =
                new Animation(FrameSequence(2, 2), timings, true);
            animations["jet-attacking"] =
                new Animation(FrameSequence(6, 2), timings, true);
            animations["begin-jet"] =
                new Animation(FrameSequence(2, 2), timings, true);
            animations["begin-jet-attacking"] =
                new Animation(FrameSequence(6, 2), timings, true);
            animations["stop-jet"] =
                new Animation(FrameSequence(2, 2), timings, true);
            animations["stop-jet-attacking"] =
                new Animation(FrameSequence(6, 2), timings, true);
            animations["jump"] =
                new Animation(FrameSequence(0, 2), timings, true);
            animations["jump-attacking"] =
                new Animation(FrameSequence(4, 2), timings, true);
            animations["fall"] =
                new Animation(FrameSequence(0, 2), timings, true);
            animations["fall-attacking"] =
                new Animation(FrameSequence(4, 2), timings, true);
            animations["land"] =
                new Animation(FrameSequence(0, 2), timings, true);
            animations["land-attacking"] =
                new Animation(FrameSequence(4, 2), timings, true);
            animations["run"] =
                new Animation(FrameSequence(0, 2), timings, true);
            animations["run-attacking"] =
                new Animation(FrameSequence(4, 2), timings, true);

            animations["stand-still"] =
                new Animation(FrameSequence(1, 1), TimingSequence(5, 1), false);
            Play("default");

            Wrench = new CycSprite(Game);
            Wrench.Initialize();
            Wrench.AddAnimation("default", new int[] { 0, 1 }, new int[] { 5, 5 }, true);
            Wrench.AddAnimation("super", new int[] { 2, 3 }, new int[] { 5, 5 }, true);
            Wrench.Play("default");
            Wrench.AssetName = "wrench";
            Wrench.Visible = false;
            Wrench.Alive = false;
            Wrench.CollisionStyle = CollisionStyle.Circle;
            Wrench.SpriteWidth = 14;
            Wrench.ScaleFactor = 2.0f;
            Wrench.Radius = 14;
            Wrench.VisualRadius = 14;
            Wrench.LoadContent();

            deathSnd = Game.SoundInstance("rpg-die");
            jetHighSnd = Game.SoundInstance("rpg-jet-high");
            jetMidSnd = Game.SoundInstance("rpg-jet-mid");
            jetLowSnd = Game.SoundInstance("rpg-jet-low");
            jumpSnd = Game.SoundInstance("rpg-jump");
            landSnd = Game.SoundInstance("rpg-land");

            base.LoadContent();
            normalTexture = spriteSheet;
            superTexture = Game.Content.Load<Texture2D>("rockGirlSuper");
        }