/// <summary> /// initializes this screen. /// configures the second stage, which will be visited /// when the first stage is cleared. /// </summary> public override void InitializeScreen() { base.InitializeScreen(); NextScreen = new LoadingScreen(); NextScreen.NextScreen = new SecondStageScreen(); TransitionOffTime = TimeSpan.FromSeconds(8.0f); FrameworkCore.RenderContext.ClearColor = Color.Black; // initializes for world everything. InitWorld(); // initializes for camera for this stage. InitCamera(); // Load Hud CreateHud(); for (int i = 0; i < GameLevel.PlayerCountInLevel; i++) { GamePlayer gamePlayer = GameLevel.GetPlayerInLevel(i); // Update selected weapon image in the Hud SetCurrentWeaponHud(i, gamePlayer.CurrentWeapon.WeaponType); } // Play a background music soundBGM = GameSound.Play(SoundTrack.FirstStage); }
/// <summary> /// Moves to selected menu. /// </summary> /// <param name="inputIndex">an index of the input</param> /// <param name="verticalEntryIndex"> /// a vertical index of selected entry /// </param> /// <param name="horizontalEntryIndex"> /// a horizontal index of selected entry /// </param> public override void OnSelectedEntry(int inputIndex, int verticalEntryIndex, int horizontalEntryIndex) { // It prevents more than one input. if (inputIndex != 0) return; if (ScreenState == ScreenState.Active) { // If selected a start button, jump to the first stage screen if (verticalEntryIndex == 0) { NextScreen = new LoadingScreen(); NextScreen.NextScreen = new FirstStageScreen(); TransitionOffTime = TimeSpan.FromSeconds(1.0f); ExitScreen(); } // If selected a versus button, jump to the versus ready screen else if (verticalEntryIndex == 1) { NextScreen = new VersusReadyScreen(); TransitionOffTime = TimeSpan.FromSeconds(1.0f); ExitScreen(); } // If selected a exit button, exit the program else if (verticalEntryIndex == 2) { // Allows the default game to exit on Xbox 360 and Windows MessageBoxScreen messageBox = new MessageBoxScreen("Are you sure you want to exit?"); // Register message box handle method messageBox.Accepted += RobotGameGame.ExitAccepted; GameScreenManager.AddScreen(messageBox, true); } // Play the select sound GameSound.Play(SoundTrack.MenuClose); } }
/// <summary> /// Moves to selected menu. /// </summary> /// <param name="inputIndex">an index of the input</param> /// <param name="verticalEntryIndex">vertical index of selected entry</param> /// <param name="horizontalEntryIndex">horizontal index of selected entry</param> public override void OnSelectedEntry(int inputIndex, int verticalEntryIndex, int horizontalEntryIndex) { // It prevents more than one input. if (inputIndex != 0) { return; } if (ScreenState == ScreenState.Active) { VersusGameInfo versusInfo = new VersusGameInfo(); versusInfo.playerSpec = new string[2]; for (int i = 0; i < 2; i++) { switch (focusIndex[i]) { case 0: // Grund { versusInfo.playerSpec[i] = "Data/Players/VersusGrund.spec"; } break; case 1: // Mark { versusInfo.playerSpec[i] = "Data/Players/VersusMark.spec"; } break; case 2: // Kiev { versusInfo.playerSpec[i] = "Data/Players/VersusKiev.spec"; } break; case 3: // Yager { versusInfo.playerSpec[i] = "Data/Players/VersusYager.spec"; } break; } } // Set to kill point versusInfo.killPoint = killPoint; // Set to versus information RobotGameGame.VersusGameInfo = versusInfo; // Play a select sound GameSound.Play(SoundTrack.MenuClose); // versus game start!! NextScreen = new LoadingScreen(); NextScreen.NextScreen = new VersusStageScreen(); TransitionOffTime = TimeSpan.FromSeconds(1.0f); ExitScreen(); } }