public override void Update(Game1 game) { foreach (Button b in but) { b.CheckCursor(); } mouseState = Mouse.GetState(); KeyboardState ks = Keyboard.GetState(); if (ks.IsKeyDown(Keys.Escape) && kspast.IsKeyUp(Keys.Escape)) { isGame = true; MediaPlayer.Stop(); } if (mouseState.LeftButton == ButtonState.Pressed && mouseStatePast.LeftButton == ButtonState.Released) { if (Play.rectangle.Contains(mouseState.Position)) { isGame = true; MediaPlayer.Stop(); } else if (Settings.rectangle.Contains(mouseState.Position)) { menu = new Settings(); } else if (Exit.rectangle.Contains(mouseState.Position)) { game.Exit(); } else if (MainMenu.rectangle.Contains(mouseState.Position)) { game.Exit(); Game game1 = new Game1(); game1.Run(); } } mouseStatePast = mouseState; kspast = ks; }
public override void Update(Game1 game) { foreach (Button b in but) { b.CheckCursor(); } mouseState = Mouse.GetState(); if (mouseState.LeftButton == ButtonState.Pressed && mouseStatePast.LeftButton == ButtonState.Released) { if (Play.rectangle.Contains(mouseState.Position)) { menu = new Play(); //isGame = true; } else if (CrMod.rectangle.Contains(mouseState.Position)) { // Process pr=Process.Start(@"C:\Users\Андрей\Desktop\Проекты\CRMod\Game1\bin\Windows\x86\Debug\Game1.exe"); game.Exit(); Game game1 = new CRMod.Game1(); game1.Run(); // while (Process.GetProcessById(pr.Id) != null) { } //Process.GetCurrentProcess().WaitForInputIdle(; } else if (Settings.rectangle.Contains(mouseState.Position)) { menu = new Settings(); } else if (Exit.rectangle.Contains(mouseState.Position)) { game.Exit(); } } mouseStatePast = mouseState; }