Exemplo n.º 1
0
        public FlagMap(IsometricGrid2D isometricGrid)
        {
            int length = isometricGrid.gridSize;

            grid = new string[length, length];

            for (int i = 0; i < length; i++)
            {
                for (int x = 0; x < length; x++)
                {
                    grid[i, x] = "0";
                }
            }

            Map = new TileMap(grid, "0");
        }
Exemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            typeof(Panel).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, Canvas, new object[] { true });

            isometricGrid = new IsometricGrid3D(315, 200, 9, 3);

            mineManager = new MineManager(isometricGrid, 10);

            renderers.Add(new Renderer2D(isometricGrid.to2D(0), TileMapTemplates.FilledGrid(isometricGrid.to2D(0)), Properties.Resources.TileBase));
            renderers.Add(new Renderer2D(isometricGrid.to2D(0), mineManager.mineMap, Properties.Resources.Mine));
            renderers.Add(new Renderer2D(isometricGrid.to2D(0), TileMapTemplates.FilledGrid(isometricGrid.to2D(0)), Properties.Resources.GrassTop));

            playerGrid = isometricGrid.to2D(1);
            flagGrid   = isometricGrid.to2D(1);

            flagMap = new FlagMap(flagGrid);

            renderers.Add(flagRenderer());

            colliders = Collision.placeColliders(playerGrid, TileMapTemplates.FilledGrid(playerGrid));
        }