Shooter.MapClasses.Map.Map C# (CSharp) Method

Map() public method

public Map ( Microsoft.Xna.Framework.Content.ContentManager content, int screenWidth, int screenHeight ) : Microsoft.Xna.Framework
content Microsoft.Xna.Framework.Content.ContentManager
screenWidth int
screenHeight int
return Microsoft.Xna.Framework
        public Map(ContentManager content, int screenWidth, int screenHeight) {
            tileSize = screenWidth / 20;
            tileMap = new Texture2D[20, 100];
            objectMap = new MapObject[tileMap.GetLength(0), tileMap.GetLength(1)];
            tileRot = new int[tileMap.GetLength(0), tileMap.GetLength(1)];
            objRot = new int[tileMap.GetLength(0), tileMap.GetLength(1)];
            //loops through entire tileMap array and sets each value to concrete
            for (int i = 0; i < tileMap.GetLength(0); i++) {
                for (int j = 0; j < tileMap.GetLength(1); j++) {
                    tileMap[i, j] = content.Load<Texture2D>("ConcreteCorner");
                }
            }
            //loops through objectMap array and sets edges to noTexture
            for (int i = 0; i < objectMap.GetLength(0); i++) {
                for (int j = 0; j < objectMap.GetLength(1); j++) {
                    objectMap[i, j] = new MapObject(content, true, "NoTexture", i, j);
                }
            }
            for (int i = 1; i < objectMap.GetLength(0) - 1; i++) {
                for (int j = 1; j < objectMap.GetLength(1) - 1; j++) {
                    objectMap[i, j] = null;
                }
            }
            for (int i = 1; i < objectMap.GetLength(0); i += 6) {
                for (int j = 0; j < objectMap.GetLength(1) - 3; j++) {
                    objectMap[i, j] = new MapObject(content, true, "NoTexture", i, j);
                }
            }
        }

Same methods

Map::Map ( Microsoft.Xna.Framework.Content.ContentManager content, string filename, Camera c, Character player, List enemies, int screenWidth ) : Microsoft.Xna.Framework