示例#1
0
        //Constructor with level difficulty
        public Game1(string diff, int levelNum)
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;
            Content.RootDirectory = "Content";

            LevelDifficulties curLevelDifficulty = (LevelDifficulties)Enum.Parse(typeof(LevelDifficulties), diff);

            //bm = new BaseMap(new int[3, 7, 7]{{{14, 8, 8, 12, 13, 10, 9}, {14, 0, 0, 9, 15, 3, 7}, {15, 2, 1, 7, 11, 2, 9}, {11, 7, 7, 14, 4, 0, 1}, {2, 9, 10, 8, 9, 2, 5}, {3, 6, 5, 3, 3, 2, 9}, {6, 13, 14, 5, 7, 6, 5}}, {{15, 15, 15, 14, 12, 8, 13}, {10, 13, 10, 9, 10, 4, 13}, {2, 12, 0, 4, 4, 8, 9}, {7, 14, 0, 13, 10, 4, 1}, {14, 13, 6, 8, 5, 10, 1}, {14, 8, 9, 7, 15, 7, 7}, {14, 5, 7, 15, 15, 14, 13}}, {{15, 14, 13, 10, 13, 15, 15}, {11, 14, 8, 5, 15, 10, 9}, {7, 14, 1, 15, 10, 4, 5}, {14, 13, 7, 15, 3, 10, 9}, {14, 9, 15, 15, 3, 7, 3}, {10, 1, 11, 15, 6, 12, 1}, {6, 5, 6, 12, 12, 12, 5}}});
            bm   = new BaseMap(Levels.GetLevel(curLevelDifficulty, levelNum).field);
            map  = new Map(bm);
            mole = new Mole();
            graphics.PreferredBackBufferHeight = 900;
            graphics.PreferredBackBufferWidth  = 1600;
        }