public override void Update(GameTime gameTime) { MouseState mouseClick = Mouse.GetState(); timer -= gameTime.ElapsedGameTime.TotalSeconds; foreach (var button in buttons) { if (Mouse.GetState().X > button.Value.Left && Mouse.GetState().X < button.Value.Right && Mouse.GetState().Y > button.Value.Top && Mouse.GetState().Y < button.Value.Bottom) { if (mouseClick.LeftButton == ButtonState.Pressed) { if (button.Key.Equals("local")) { buttonClick.Play(); ScreenManager.Instance.ChangeScreen(new SplashScreen(), true); MediaPlayer.Stop(); } else if (button.Key.Equals("multiplayer")) //this feature isn't implemented yet? { errorClick.Play(); } else if (button.Key.Equals("options") && timer <= 0) { buttonClick.Play(); timer = 0.1; TitleScreen s = this; ScreenManager.Instance.ChangeScreen(new OptionsScreen(s), true); } else if (button.Key.Equals("exit")) { Environment.Exit(0); } } } } }
public OptionsScreen(TitleScreen titlescreen) { this.titlescreen = titlescreen; }
public PauseScreen(TitleScreen titlescreen) { this.titlescreen = titlescreen; }