public ISprite build(Vector2 position, IEnemyState state)
        {
            ISprite sprite = null;

            if (state is DeadGoomba)
            {
                sprite = new SpriteStatic(_goombaFlatTex, true);
            }
            else if (state is WalkingGoomba)
            {
                sprite = new SpriteAnimated(_goombaWalkTex, 1, 2, 4, true);
            }
            else if (state is WalkingGreenKoopa)
            {
                sprite = new SpriteAnimated(_koopaGreenWalkLeft, 1, 2, 4, true);
            }
            else if (state is WalkingRedKoopa)
            {
                sprite = new SpriteAnimated(_koopaRedWalkLeft, 1, 2, 4, true);
            }
            else if (state is DeadGreenKoopa)
            {
                sprite = new SpriteStatic(_koopaGreenShell, true);
            }
            else if (state is DeadRedKoopa)
            {
                sprite = new SpriteStatic(_koopaRedShell, true);
            }
            else if (state is PirhanaPlant)
            {
                sprite = new SpriteAnimated(_pirhana, 1, 2, 3, true);
            }

            return(sprite);
        }
        public ISprite build(string type)
        {
            ISprite sprite;

            switch (type)
            {
            case "pipe_head":
                sprite = new SpriteStatic(_pipeHeadTex, true);
                break;

            case "pipe_section":
                sprite = new SpriteStatic(_pipeSectionTex, true);
                break;

            case "flag":
                sprite = new SpriteStatic(_flagTex, true);
                break;

            case "castle":
                sprite = new SpriteStatic(_castleTex, true);
                break;

            case "brick_piece":
                sprite = new SpriteAnimated(_brickPieceTex, 1, 4, 8, true);
                break;

            default:
                sprite = null;
                break;
            }
            return(sprite);
        }
Example #3
0
        public ISprite build(string state)
        {
            ISprite sprite;

            switch (state)
            {
            case "brickPiece":
                sprite = new SpriteAnimated(_brickPieceTex, 1, 4, 8, true);
                break;

            default:
                sprite = null;
                break;
            }
            return(sprite);
        }
Example #4
0
        public ISprite build(string state)
        {
            ISprite sprite;

            switch (state)
            {
            case "flat":
                sprite = new SpriteStatic(_goombaFlatTex, true);
                break;

            default:
                sprite = new SpriteAnimated(_goombaWalkTex, 1, 2, 4, true);
                break;
            }
            return(sprite);
        }
Example #5
0
        public ISprite build(string state)
        {
            ISprite sprite;

            switch (state)
            {
            case "right":
                sprite = new SpriteAnimated(_koopaRedWalkRight, 1, 2, 4, true);
                break;

            case "shell":
                sprite = new SpriteStatic(_koopaRedShell, true);
                break;

            case "legs":
                sprite = new SpriteStatic(_koopaRedShellLegs, true);
                break;

            default:
                sprite = new SpriteAnimated(_koopaRedWalkLeft, 1, 2, 4, true);
                break;
            }
            return(sprite);
        }
Example #6
0
        public ISprite build(Vector2 position, IBlockState state)
        {
            // ended up added a new factory to make the objects.  debating between trying to merge them together.  The problem i could
            // see happening there would be the inability to change the sprite in the object when the state changes without making a whole
            // new object.

            ISprite sprite;

            if (state is BrickState || state is null)
            {
                sprite = new SpriteStatic(_brickBlockTex, true);
            }
            else if (state is BrickBumpedState)
            {
                sprite = new SpriteAnimated(_brickBlockBumpedTex, 1, 7, 7, true);
            }
            else if (state is BrickBrokenState)
            {
                sprite = new SpriteAnimated(_brickBlockBrokenTex, 1, 3, 4, true);
            }
            else if (state is StairState)
            {
                sprite = new SpriteStatic(_stairBlockTex, true);
            }
            else if (state is UsedState)
            {
                sprite = new SpriteStatic(_usedBlockTex, true);
            }
            else if (state is UsedBumpedState)
            {
                sprite = new SpriteAnimated(_usedBlockBumpedTex, 1, 7, 14, true);
            }
            else if (state is QuestionState)
            {
                sprite = new SpriteAnimated(_questionBlockTex, 1, 3, 4, true);
            }
            else if (state is HiddenState)
            {
                sprite = new SpriteStatic(_invisibleBlockTex, true);
            }
            else if (state is FloorState)
            {
                sprite = new SpriteStatic(_floorBlockTex, true);
            }
            else
            {
                sprite = new SpriteStatic(_brickBlockTex, true);
            }

            //ISprite sprite;
            //Console.WriteLine(state);
            //char[] separators = new char[] { '.' };
            //string test = state.Split(separators, StringSplitOptions.RemoveEmptyEntries)[1];
            //Console.WriteLine(test);
            //switch (test)
            //{
            //    case "BrickState":
            //        sprite = new SpriteStatic(_brickBlockTex, true);
            //        break;
            //    case "BrickBumpedState":
            //        sprite = new SpriteStatic(_brickBlockTex, true);
            //        break;
            //    case "BrickBrokenState":
            //        sprite = new SpriteAnimated(_brickBlockBrokenTex, 1, 3, 4, true);
            //        break;
            //    case "StairState":
            //        sprite = new SpriteStatic(_stairBlockTex, true);
            //        break;
            //    case "UsedState":
            //        sprite = new SpriteStatic(_usedBlockTex, true);
            //        break;
            //    case "UsedBumpedState":
            //        sprite = new SpriteAnimated(_usedBlockBumpedTex, 1, 7, 14, true);
            //        break;
            //    case "QuestionState":
            //        sprite = new SpriteAnimated(_questionBlockTex, 1, 3, 4, true);
            //        break;
            //    case "HiddenState":
            //        sprite = new SpriteStatic(_invisibleBlockTex, true);
            //        break;
            //    case "FloorState":
            //        sprite = new SpriteStatic(_floorBlockTex, true);
            //        break;
            //    default:
            //        sprite = new SpriteStatic(_brickBlockTex, true);
            //        break;
            //}

            return(sprite);
        }
Example #7
0
        public ISprite build(string state)
        {
            ISprite sprite;

            switch (state)
            {
            case "super":
                sprite = new SpriteStatic(_mushroomSuperTex, true);
                break;

            case "1up":
                sprite = new SpriteStatic(_mushroom1UpTex, true);
                break;

            case "fire":
                sprite = new SpriteAnimated(_fireFlowerTex, 1, 4, 8, true);
                break;

            case "star":
                sprite = new SpriteAnimated(_starmanTex, 1, 4, 8, true);
                break;

            case "small_pipe":
                sprite = new SpriteStatic(_smallWarpPipe, true);
                break;

            case "medium_pipe":
                sprite = new SpriteStatic(_mediumWarpPipe, true);
                break;

            case "large_pipe":
                sprite = new SpriteStatic(_largeWarPipe, true);
                break;

            case "castle":
                sprite = new SpriteStatic(_castle, true);
                break;

            case "flag_pole":
                sprite = new SpriteStatic(_flagPole, true);
                break;

            case "flag":
                sprite = new SpriteStatic(_flag, true);
                break;

            case "brick_piece":
                sprite = new SpriteAnimated(_brickPieceTex, 1, 4, 8, true);
                break;

            case "speed":
                sprite = new SpriteStatic(_speedPotion, true);
                break;

            case "jump":
                sprite = new SpriteStatic(_doublePotion, true);
                break;

            case "propeller":
                sprite = new SpriteStatic(_propeller, true);
                break;

            default:
                sprite = new SpriteAnimated(_coinSpinningTex, 1, 4, 8, true);
                break;
            }
            return(sprite);
        }