public Scene_Rule() { // Set game rule GameRule.Open = true; GameRule.Same = true; GameRule.Plus = true; GameRule.Elemental = true; GameRule.Random = true; // Initialize the game TripleTriadGame.Initialize(); // Set background background = new Sprite(); background.LoadContent("Game Complete Screen"); background.Depth = 0; // Scale the board to fit the screen Global.BoardScaleH = (float)Global.ScreenWidth / background.ViewportWidth; Global.BoardScaleV = (float)Global.ScreenHeight / background.ViewportHeight; // Initialize Rule Window InitRuleWindow(); // Initialize Help Window InitHelpWindow(); Song BGM = Global.Content.Load <Song>("Audio/15"); MediaPlayer.Stop(); MediaPlayer.Play(BGM); MediaPlayer.IsRepeating = true; }
public override void Update(GameTime gameTime) { base.Update(gameTime); if (Global.KeyboardManager.IsKeyPressedAndReleased(Keys.Enter)) { if (GameRule.Random) { TripleTriadGame.GenerateTestHands2(); Global.SceneManager.CurrentScene = new Scene_Triple_Triad_Main(); } //else // Global.SceneManager.CurrentScene = new Scene_PickCards(); } _HelpWindow.Width = (int)(background.ViewportWidth * Global.BoardScaleH - Global.BoardScaleH * 64 * 2); _HelpWindow.ScreenPosition = new Vector2((int)(Global.BoardScaleH * 64), (int)(Global.ScreenHeight - _HelpWindow.Height - Global.BoardScaleV * 16)); _HelpWindow.Update(gameTime); _RuleWindow.ScreenPosition = new Vector2((int)(Global.BoardScaleH * 64), (int)(Global.BoardScaleV * 16)); _RuleWindow.Width = (int)(background.ViewportWidth * Global.BoardScaleH - Global.BoardScaleH * 64 * 2); _RuleWindow.Height = (int)(_HelpWindow.ScreenPosition.Y - _RuleWindow.ScreenPosition.Y - Global.BoardScaleV * 8); _RuleWindow.Update(gameTime); }