private void SetLevelByName(string name) { if (name == "StartLevel") { FlatRedBallServices.GraphicsOptions.BackgroundColor = Color.CornflowerBlue; } else if (name == "EndLevel") { FlatRedBallServices.GraphicsOptions.BackgroundColor = Color.Gray; } else { FlatRedBallServices.GraphicsOptions.BackgroundColor = Color.Black; } switchingLevels = true; TiledMap.RemoveFromManagersOneWay(); TiledMap.RemoveSelfFromListsBelongingTo(); TiledMap.Destroy(); RemoveShapes(TileCollisionShapes); RemoveShapes(EntityCollisionShapes); RemoveShapes(EnemyCollisionGround); ClearList(); TiledMap = (LayeredTileMap)GetMember(name); TiledMap.AddToManagers(); SetUpTiles(); switchingLevels = false; }