Пример #1
0
 // size in
 public CollisionTile(int x, int y, CollisionTile[,] grid)
 {
     entities = new List<Entity.Entity>();
     loc = new FloatRectangle(x, y, SIDE_LENGTH, SIDE_LENGTH);
     isWalkable = true;
     this.grid = grid;
 }
        public void SwitchWorld()
        {
            grid = new CollisionTile[mainGame.worldManager.CurrentWorld.manager.world.worldHeight, mainGame.worldManager.CurrentWorld.manager.world.worldWidth];

            // Setup tile grid.
            for (int x = 0; x < grid.GetLength(0); x++)
                for (int y = 0; y < grid.GetLength(1); y++)
                {
                    grid[x, y] = new CollisionTile(x * CollisionTile.SIDE_LENGTH, y * CollisionTile.SIDE_LENGTH, grid);
                }
        }