当前位置: 首页>>代码示例>>C#>>正文


C# GameState.setState方法代码示例

本文整理汇总了C#中GameState.setState方法的典型用法代码示例。如果您正苦于以下问题:C# GameState.setState方法的具体用法?C# GameState.setState怎么用?C# GameState.setState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameState的用法示例。


在下文中一共展示了GameState.setState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            gameState = new GameState();

            gameStart = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);

            board = new GameBoard(new Vector2(33, 25), new Vector2(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight));
            darwin = new Darwin(board);

            zTime = new ZombieTime(board);

            nurseryOne = new Nursery(board, darwin);
            nurseryTwo = new Nursery(board, darwin);

            fatBossZombie = new FatBossZombie(15, 4, 19, 14, 4, 3, darwin, board);
            fatBossZombie.resetGapeMode();
            stairs = new Stairs(board);

            walls = setWallsInLevelSix();

            setLevelState();
            gameState.setState(GameState.state.Start);
        }
开发者ID:rizzen93,项目名称:legendofdarwin,代码行数:28,代码来源:Level6.cs

示例2: Initialize

        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            gameState = new GameState();
            gameStart = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);
            gameState.setState(GameState.state.Start);

            board = new GameBoard(new Vector2(33, 25), new Vector2(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight));
            darwin = new Darwin(board);
            //firstZombie = new Zombie(10, 10, 15, 5, 15, 5, board);
            //secondZombie = new Zombie(10, 16, 15, 5, 15, 5, board);
            //thirdZombie = new Zombie(12, 10, 15, 5, 15, 5, board);

            Vector2[] myPath = new Vector2[4];
            myPath[0] = new Vector2(8, 4);
            myPath[1] = new Vector2(8, 19);
            myPath[2] = new Vector2(25, 19);
            myPath[3] = new Vector2(25, 4);

            leaderZombie = new CongaLeaderZombie(8, 4, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath, darwin, board);

            followerZombies = new List<CongaFollowerZombie>();

            // all conga paths for the different conga zombies are created here along with all conga zombies
            myPath = new Vector2[8];
            myPath[0] = new Vector2(8,4);
            myPath[1] = new Vector2(8, 12);
            myPath[2] = new Vector2(8,19);
            myPath[3] = new Vector2(17, 19);
            myPath[4] = new Vector2(25,19);
            myPath[5] = new Vector2(25, 12);
            myPath[6] = new Vector2(25,4);
            myPath[7] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(10,4,board.getNumSquaresX(),0,board.getNumSquaresY(),0,myPath,leaderZombie,darwin,board));
            followerZombies.Add(new CongaFollowerZombie(12, 4, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath, leaderZombie,darwin, board));
            followerZombies.Add(new CongaFollowerZombie(14, 4, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath, leaderZombie,darwin, board));

            myPath = new Vector2[8];
            myPath[2] = new Vector2(8, 4);
            myPath[3] = new Vector2(8, 12);
            myPath[4] = new Vector2(8, 19);
            myPath[5] = new Vector2(17, 19);
            myPath[6] = new Vector2(25, 19);
            myPath[7] = new Vector2(25, 12);
            myPath[0] = new Vector2(25, 4);
            myPath[1] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(25, 8, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(25, 10, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(25, 14, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];
            myPath[4] = new Vector2(8, 4);
            myPath[5] = new Vector2(8, 12);
            myPath[6] = new Vector2(8, 19);
            myPath[7] = new Vector2(17, 19);
            myPath[0] = new Vector2(25, 19);
            myPath[1] = new Vector2(25, 12);
            myPath[2] = new Vector2(25, 4);
            myPath[3] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(22, 19, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(16, 19, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(14, 19, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];
            myPath[6] = new Vector2(8, 4);
            myPath[7] = new Vector2(8, 12);
            myPath[0] = new Vector2(8, 19);
            myPath[1] = new Vector2(17, 19);
            myPath[2] = new Vector2(25, 19);
            myPath[3] = new Vector2(25, 12);
            myPath[4] = new Vector2(25, 4);
            myPath[5] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(8, 12, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(8, 15, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];

            myPath[3] = new Vector2(8, 4);
            myPath[4] = new Vector2(8, 12);
            myPath[5] = new Vector2(8, 19);
            myPath[6] = new Vector2(17, 19);
            myPath[7] = new Vector2(25, 19);
            myPath[0] = new Vector2(25, 16);
            myPath[1] = new Vector2(25, 4);
            myPath[2] = new Vector2(17, 4);

            followerZombies.Add(new CongaFollowerZombie(29, 17, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(29, 15, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(29, 16, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));
            followerZombies.Add(new CongaFollowerZombie(29, 13, board.getNumSquaresX(), 0, board.getNumSquaresY(), 0, myPath,leaderZombie, darwin, board));

            myPath = new Vector2[8];
//.........这里部分代码省略.........
开发者ID:rizzen93,项目名称:legendofdarwin,代码行数:101,代码来源:Level4.cs

示例3: Initialize

        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            gameState = new GameState();
            gameStart = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);
            gameState.setState(GameState.state.Level);

            board = new GameBoard(new Vector2(33, 25), new Vector2(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight));
            darwin = new Darwin(board);

            String zombieString = "This a zombie,\n don't near him \nas a human!!";
            zombieMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, zombieString);

            String darwinString = "This is darwin,\n move with arrows, \n z to transform, \n a for actions";
            darwinMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, darwinString);

            stairs = new Stairs(board);
            if (board.isGridPositionOpen(5, 18))
            {
                stairs.setGridPosition(5, 18);
            }

            // Initial starting position
            darwin.setGridPosition(6, 18);
            if (board.isGridPositionOpen(darwin))
            {
                board.setGridPositionOccupied(darwin.X, darwin.Y);
                darwin.setPosition(board.getPosition(darwin).X, board.getPosition(darwin).Y);
            }

            // Darwin's lag movement
            counterReady = counter = 5;

            zTime = new ZombieTime(board);
            zTimeReset = new ZombieTime(board);

            setPotionPosition(27, 5);

            setBoxes();
            setBoxPattern();
            pattern = new BoxPattern(board, spotsForPattern);

            setVortexes();

            setWalls();

            snake = new Snake(10, 9, 27, 5, 18, 5, board);
            snake2 = new Snake(8, 15, 27, 5, 18, 5, board);
            snake3 = new Snake(21, 9, 27, 5, 18, 5, board);
            snake4 = new Snake(21, 15, 27, 5, 18, 5, board);

            northZombie = new PyroZombie(15, 3, 25, 4, 3, 3, board);
            northZombie.setGridPosition(15, 3);
            northZombie.setCurrentPatrolPoint(new Vector2(27, 3));
            northZombie.setNextPatrolPoint(new Vector2(5, 3));
            
            southZombie = new PyroZombie(15, 20, 25, 4, 20, 20, board);
            southZombie.setGridPosition(15, 20);
            southZombie.setCurrentPatrolPoint(new Vector2(5, 20));
            southZombie.setNextPatrolPoint(new Vector2(27, 20));
           
            eastZombie = new PyroZombie(29, 11, 29, 29, 19, 4, board);
            eastZombie.setGridPosition(29, 11);
            eastZombie.setCurrentPatrolPoint(new Vector2(29, 17));
            eastZombie.setNextPatrolPoint(new Vector2(29, 6));

            westZombie = new PyroZombie(3, 11, 3, 3, 19, 4, board);
            westZombie.setGridPosition(3, 11);
            westZombie.setCurrentPatrolPoint(new Vector2(3, 5));
            westZombie.setNextPatrolPoint(new Vector2(3, 18));

            flames = new LinkedList<Flame>();

        }
开发者ID:gkericks,项目名称:legend-of-darwin,代码行数:78,代码来源:Level5.cs


注:本文中的GameState.setState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。