Example #1
0
        public LeftMovingTeno(Teno teno)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.leftMovingTeno);
            this.teno = teno;
        }
Example #2
0
 public Teno(Vector2 position)
 {
     state         = new RightIdleTS(this);
     physState     = new GroundState(this);
     this.position = position;
     factory       = new SpriteFactory();
 }
Example #3
0
        public ICollectable build(CollectableType type, Vector2 location)
        {
            factory = new SpriteFactory();

            /*if (type == CollectableType.coin)
             * {
             *  product = new Coin(location);
             * }*/
            if (type == CollectableType.star)
            {
                product = new Coin(location, game);
            }
            if (type == CollectableType.oneUp)
            {
                //product = new OneUpMushroom(location);
            }
            if (type == CollectableType.fireFlower)
            {
                //product = new FireFlower(location);
            }
            if (type == CollectableType.superMushroom)
            {
                //product = new SuperMushroom(location);
            }
            if (type == CollectableType.ninja)
            {
                //product = new Ninja(location);
            }

            return(product);
        }
Example #4
0
        public RightIdleTeno(Teno teno)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.rightIdleTeno);
            this.teno = teno;
        }
Example #5
0
        public RightMovingTeno(Teno teno, Game1 game)
        {
            this.game = game;
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.rightRunTeno);
            this.teno = teno;
        }
Example #6
0
        public DeadTeno(Teno teno)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.deadTeno);
            this.teno = teno;
            Game1.GetInstance().gameState = new DeadGameState(teno);
        }
Example #7
0
 public Teno(Vector2 position, Game1 game)
 {
     this.game     = game;
     state         = new RightIdleTeno(this, game);
     physState     = new GroundState(this, game);
     this.position = position;
     factory       = new SpriteFactory();
 }
Example #8
0
        public LeftIdleTeno(Teno teno, Game1 game)
        {
            this.game = game;
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.leftIdleTeno);
            this.teno = teno;
        }
Example #9
0
        public GUI(Game1 game)
        {
            this.game = game;
            options   = new List <KeyValuePair <ICommands, String> >();
            font      = Game1.gameContent.Load <SpriteFont>(StringHolder.hudPauseFont);
            factory   = new SpriteFactory();
            coin      = factory.build(SpriteFactory.sprites.star);

            //options.AddRange(new LoadLevelCommand(game.level.levelCurrent, game), "Level 1");
        }
Example #10
0
 public TitleScreenGameState()
 {
     factory = new SpriteFactory();
     logo    = factory.build(SpriteFactory.sprites.title);
     //SoundManager.PlaySong(SoundManager.songs.title);
     game = Game1.GetInstance();
     menu = new GUI(game);
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadLevelCommand(StringHolder.levelOne), "Level 1"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadLevelCommand(StringHolder.levelTwo), "Level 2"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadLevelCommand(StringHolder.levelThree), "Level 3"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new LoadAchPageCommand(), "Achievements"));
     menu.options.Add(new KeyValuePair <ICommands, String>(new QuitCommand(), "Quit"));
     menu.currentCommand     = menu.options[0].Key;
     game.keyboardController = new TitleKeyController(menu);
 }
Example #11
0
        public DeadTeno(Teno teno, Game1 game)
        {
            this.game = game;
            ISpriteFactory factory = new SpriteFactory();

            if (teno.state.GetType().Equals(new RightCrouchingTeno(teno, game).GetType()) || teno.state.GetType().Equals(new RightFallingTeno(teno, game).GetType()) ||
                teno.state.GetType().Equals(new RightIdleTeno(teno, game).GetType()) || teno.state.GetType().Equals(new RightJumpingTeno(teno, game).GetType()) ||
                teno.state.GetType().Equals(new RightMovingTeno(teno, game).GetType()))
            {
                Sprite = factory.build(SpriteFactory.sprites.rightDeadTeno);
            }
            else
            {
                Sprite = factory.build(SpriteFactory.sprites.leftDeadTeno);
            }
            this.teno      = teno;
            game.gameState = new DeadGameState(teno, game);
        }
Example #12
0
        public LeftDeadGiaiTichState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.leftDeadGiaiTich);
        }
Example #13
0
        public DeadShellessKS()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.deadShellessKoopa);
        }
Example #14
0
        public RightGiaiTichState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.rightGiaiTich);
        }
Example #15
0
        public RightDeadSXTKState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.rightDeadSXTK);
        }
Example #16
0
        public RightSmashedDinoState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.walkingRightSquishedDino);
        }
Example #17
0
        public LeftTallDinoState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.walkingLeftDino);
        }
Example #18
0
        public RightLy2State()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.rightLy2);
        }
Example #19
0
        public LeftDeadSXTKState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.leftDeadSXTK);
        }
Example #20
0
        public RightWalkingShellessKS()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.rightWalkShellessKoopa);
        }
Example #21
0
        public DeadDinoState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.leftDeadDino);
        }
Example #22
0
        public LeftDeadHoaDCState()
        {
            ISpriteFactory factory = new SpriteFactory();

            sprite = factory.build(SpriteFactory.sprites.leftDeadHoaDC);
        }
Example #23
0
        public Block build(BlockType type, Vector2 location)
        {
            prize   = null;
            factory = new SpriteFactory();


            if (type == BlockType.ground)
            {
                state = new GenericBlockState(SpriteFactory.sprites.ground);
            }

            if (type == BlockType.gai)
            {
                state = new DamageBlockState(SpriteFactory.sprites.gai);
            }
            if (type == BlockType.catus1)
            {
                state = new DamageBlockState(SpriteFactory.sprites.catus1);
            }
            if (type == BlockType.catus2)
            {
                state = new DamageBlockState(SpriteFactory.sprites.catus2);
            }
            if (type == BlockType.sea)
            {
                state = new DamageBlockState(SpriteFactory.sprites.sea);
            }
            /* Node : GaiBlockState là class có những block gai gây damage */

            if (type == BlockType.stone1)
            {
                state = new GenericBlockState(SpriteFactory.sprites.stone1);
            }
            if (type == BlockType.stone2)
            {
                state = new GenericBlockState(SpriteFactory.sprites.stone2);
            }
            if (type == BlockType.stone3)
            {
                state = new GenericBlockState(SpriteFactory.sprites.stone3);
            }
            if (type == BlockType.stone4)
            {
                state = new GenericBlockState(SpriteFactory.sprites.stone4);
            }
            if (type == BlockType.stoneblock)
            {
                state = new GenericBlockState(SpriteFactory.sprites.stoneblock);
            }
            if (type == BlockType.crate)
            {
                state = new GenericBlockState(SpriteFactory.sprites.crate);
            }

            if (type == BlockType.mushroom1)
            {
                state = new TrampolineBlockState(SpriteFactory.sprites.mushroom1);
            }
            if (type == BlockType.mushroom2)
            {
                state = new TrampolineBlockState(SpriteFactory.sprites.mushroom2);
            }
            Block product = new Block(location, prize, state);

            return(product);
        }