private static void CreateBaseTiles() { float[,] noiseMap = Utils.Noise.Calc2D(WORLD_WIDTH, WORLD_HEIGHT, 0.10f); tiles = new Tile[WORLD_WIDTH, WORLD_HEIGHT]; tilesGraphic = SCENE.createEntity("Tiles graphic"); for (int x = 0; x < tiles.GetUpperBound(0); x++) { for (int y = 0; y < tiles.GetUpperBound(1); y++) { Subtexture texture; if (noiseMap[x, y] < 30f) { texture = Utils.GlobalContent.Earth.Dirt; } else if (noiseMap[x, y] > 220f) { texture = Utils.GlobalContent.Earth.Sand; } else { texture = Utils.GlobalContent.Earth.Grass; } Tile tile = new Tile(texture, new Vector2(-50 + (x + 1) * 100, -50 + (y + 1) * 100), new Vector2(x, y)); tiles[x, y] = tile; if (x > 30 || y > 30) { continue; } TileSprite ts = new TileSprite(tile, texture); ts.localOffset = new Vector2(tile.GetPosition().X, tile.GetPosition().Y); tilesGraphic.addComponent(ts); tile.SetTileSprite(ts); } } }