public override ISprite Create(MarioAction action)
        {
            switch (action)
            {
            case MarioAction.Idle:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/BigIdle"), new Rectangle(0, 0, 112, 164), 1, 4, 0, 3, 4));

            case MarioAction.Walk:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/BigSprint"), new Rectangle(0, 0, 124, 164),
                                          1, 6, 0, 5, 8));

            case MarioAction.Jump:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/BigJump"), new Rectangle(0, 0, 97, 162),
                                          1, 4, 0, 3, 4));

            case MarioAction.Crouch:
                return(new StaticSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/BigCrouch"), new Rectangle(0, 0, 113, 109)));

            case MarioAction.Fall:
                return(new StaticSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/BigFall2"), new Rectangle(0, 0, 96, 171)));

            case MarioAction.Dash:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/BigSprint"), new Rectangle(0, 0, 124, 164),
                                          1, 6, 0, 5, 8));

            default:
                //default will be idling
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/BigIdle"), new Rectangle(0, 0, 112, 164), 1, 4, 0, 3, 4));
            }
        }
        public override ISprite Create(MarioAction action)
        {
            switch (action)
            {
            case MarioAction.Idle:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/FireIdle"), new Rectangle(0, 0, 114, 167), 1, 4, 0, 3, 4));

            case MarioAction.Walk:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/FireSprint"), new Rectangle(0, 0, 124, 166),
                                          1, 6, 0, 5, 8));

            /*case MarioAction.Run:
             *  return new AnimatedSprite(MarioCloneGame.GameContent.Load<Texture2D>("Sprites/SuperMario"), new Rectangle(0, 0, 96, 128),
             *      1, 8, 5, 7, 6);*/
            case MarioAction.Fall:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/FireFall"), new Rectangle(0, 0, 96, 180), 1, 4, 0, 3, 6));

            case MarioAction.Jump:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/FireJump"), new Rectangle(0, 0, 97, 167), 1, 4, 0, 3, 4));

            case MarioAction.Crouch:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/FireCrouch"), new Rectangle(0, 0, 113, 109), 1, 4, 0, 3, 4));

            case MarioAction.Dash:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/FireSprint"), new Rectangle(0, 0, 124, 166),
                                          1, 6, 0, 5, 8));

            default:
                //default will be idling
                return(new StaticSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/FireIdle"), new Rectangle(0, 0, 96, 128)));
            }
        }
예제 #3
0
 public void CallAction(MarioAction action)
 {
     if (marioActionMapping.ContainsKey(action))
     {
         marioActionMapping[action]();
     }
     else
     {
         Debug.Log("Calling action that is not in dictionary" + action.ToString());
     }
 }
예제 #4
0
        public override ISprite Create(MarioAction action)
        {
            switch (action)
            {
            case MarioAction.Idle:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/SmallIdle"), new Rectangle(0, 0, 96, 143),
                                          1, 4, 0, 3, 4));

            case MarioAction.Walk:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/SmallSprint"), new Rectangle(0, 0, 104, 139),
                                          1, 6, 0, 5, 8));

            /*case MarioAction.RunRight:
             *  return new AnimatedSprite(MarioCloneGame.GameContent.Load<Texture2D>("Sprites/SmallMario"), new Rectangle(256, 0, 64, 64),
             *      1, 6, 4, 5, 6); */
            case MarioAction.Jump:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/SmallJump"), new Rectangle(0, 0, 77, 138),
                                          1, 4, 0, 3, 4));

            case MarioAction.Dead:
                return(new SingleLoopAnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/Explode"),
                                                    new Rectangle(0, 0, 90, 92), 1, 6, 0, 5, 8));

            case MarioAction.Fall:
                return(new StaticSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/SmallFall"), new Rectangle(0, 0, 81, 144)));

            case MarioAction.Dash:
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/SmallSprint"), new Rectangle(0, 0, 104, 139),
                                          1, 6, 0, 5, 8));

            default:
                //default will be idling
                return(new AnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/SmallIdle"), new Rectangle(0, 0, 96, 143),
                                          1, 4, 0, 3, 4));
            }
        }
예제 #5
0
 public abstract ISprite Create(MarioAction action);
 public override ISprite Create(MarioAction action)
 {
     return(new SingleLoopAnimatedSprite(MarioCloneGame.GameContent.Load <Texture2D>("CustomSprites/Explode"),
                                         new Rectangle(0, 0, 90, 92), 1, 6, 0, 5, 8));
 }