public void SetAvailableComponents(ref Level newLevel) { this.currentLevel = newLevel; for (int button = 0; button < NUM_BUTTONS; button++) { this.menuButtons[button].setName(currentLevel.returnButtonName(button)); // set the texture for this button. this.menuButtons[button].Texture = newLevel.returnButtonTexture(button); } }
protected override void InitializeWorld() { // set up touch events. TouchPanel.EnabledGestures = GestureType.Tap | GestureType.DoubleTap | GestureType.FreeDrag; //| GestureType.Pinch | GestureType.PinchComplete World.SetBackgroundColor(Color.Black); levelEnded = new LevelEnd(); allLevels[0] = new Level(100f, "tallCityBackground", 0); allLevels[1] = new Level(100f, "tallCityBackground", 1); allLevels[2] = new Level(200f, "FedResAndIsland", 2); allLevels[3] = new Level(200f, "islandBackground", 3); kelvinMode = false; _screenWidth = this.Window.ClientBounds.Right; _screenHeight = this.Window.ClientBounds.Bottom; gameHud = new HudBar(this.Window.ClientBounds.Right, this.Window.ClientBounds.Bottom); this.currentGameState = GameStates.mainMenu; this.creditsScreen = new Credits(); this.levelSelectScreen = new LevelSelect(); this.mainMenuScreen = new MainMenu(); this.mainMenuScreen.Show(); gameModeIcon = new XNACS1Rectangle(new Vector2(90f, 150f), 20f, 20f, "fatCat"); //"KelvinHead"); base.InitializeWorld(); XNACS1Base.PlayBackgroundAudio("PluckyDaisy", 1.0f); }
//string[] textureArray, string[] namesArray, int[] countArray) public void SetAvailableComponents(ref Level levelRef) { // reset go button. goStopButton.Texture = "goButton"; goStopButton.Label = "GO"; goStopButton.LabelColor = Color.White; // reset timer timer.Label = "00:00"; ticksInLevel = 0; this.addMenu.SetAvailableComponents(ref levelRef); //textureArray, namesArray, countArray); }