예제 #1
0
파일: Map.cs 프로젝트: SwitchLab/MoleGame
        public Map(BaseMap bm)
        {
            List <Wall> walls = new List <Wall>();

            for (int i = 0; i < bm.array.GetLength(1); i++)
            {
                for (int j = 0; j < bm.array.GetLength(2); j++)
                {
                    walls.Add(new Wall(20, 110, new Vector2(100 * i + 490, 100 * j - 5 + 80),
                                       SetStates(new bool[] { bm.array[0, j, i].rightWall, bm.array[1, j, i].rightWall, bm.array[2, j, i].rightWall })));

                    walls.Add(new Wall(110, 20, new Vector2(100 * i - 5 + 400, 100 * j + 90 + 80),
                                       SetStates(new bool[] { bm.array[0, j, i].belowWall, bm.array[1, j, i].belowWall, bm.array[2, j, i].belowWall })));
                }
            }
            for (int i = 0; i < bm.array.GetLength(1); i++)
            {
                walls.Add(new Wall(20, 110, new Vector2(-100 + 490, 100 * i - 5 + 80),
                                   SetStates(new bool[] { true, true, true })));
            }
            for (int i = 0; i < bm.array.GetLength(2) - 1; i++)
            {
                walls.Add(new Wall(110, 20, new Vector2(100 * i - 5 + 400, -100 + 90 + 80),
                                   SetStates(new bool[] { true, true, true })));
            }
            this.walls = walls.ToArray();
        }
예제 #2
0
파일: Game1.cs 프로젝트: SwitchLab/MoleGame
        //ContentManager content;
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;
            Content.RootDirectory = "Content";

            //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(currentLevel.field);
            map  = new Map(bm);
            mole = new Mole();
            graphics.PreferredBackBufferHeight = 900;
            graphics.PreferredBackBufferWidth  = 1600;
        }
예제 #3
0
파일: Game1.cs 프로젝트: SwitchLab/MoleGame
        //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;
        }