public void Menu_Logika( KeyboardState keyboardState,SpriteBatch spriteBatch, GraphicsDevice GraphicsDevice,Graphic graphic,GameTime gameTime) { Thread.Sleep(150); keyboardState = Keyboard.GetState(); if (keyboardState.IsKeyDown(Keys.Up)) { if (CurrentMenuState > (int)menu.Play) CurrentMenuState--; if(Game1.Sound==true) menu_przeskok_sound.Play(); } if (keyboardState.IsKeyDown(Keys.Down)) { if (CurrentMenuState < (int)menu.Exit) CurrentMenuState++; if (Game1.Sound == true) menu_przeskok_sound.Play(); } graphic.Grafika_Menu(spriteBatch,CurrentMenuState,gameTime); if (keyboardState.IsKeyDown(Keys.Enter)) { if ((int)CurrentMenuState == (int)menu.Play) { Game1.GameState = Game1.Stan.Gra; if (Game1.Sound == true) menu_play_sound.Play(); Thread.Sleep(50); } if ((int)CurrentMenuState == (int)menu.Options) Game1.GameState = Game1.Stan.Options; if ((int)CurrentMenuState == (int)menu.Credits) { Game1.GameState = Game1.Stan.Credits; } if ((int)CurrentMenuState == (int)menu.Exit) Game1.GameState = Game1.Stan.Exit; } }
public void Menu_Opcje(KeyboardState keyboardState, SpriteBatch spriteBatch, GraphicsDevice GraphicsDevice, Graphic graphic, GameTime gameTime) { Thread.Sleep(150); keyboardState = Keyboard.GetState(); if (keyboardState.IsKeyDown(Keys.Up)) { if (CurrentOptionsState > (int)oMenu.Controller) CurrentOptionsState--; if (Game1.Sound == true) menu_przeskok_sound.Play(); } if (keyboardState.IsKeyDown(Keys.Down)) { if (CurrentOptionsState < (int)oMenu.Sound) CurrentOptionsState++; if (Game1.Sound == true) menu_przeskok_sound.Play(); } if (keyboardState.IsKeyDown(Keys.Right)&&CurrentOptionsState==(int)oMenu.Controller) { Thread.Sleep(100); if (CurrentControllerState < (int)oController.STM) { CurrentControllerState++; } else { CurrentControllerState--; } if (Game1.Sound == true) menu_przeskok_sound.Play(); } if (keyboardState.IsKeyDown(Keys.Left) && CurrentOptionsState == (int)oMenu.Controller) { Thread.Sleep(100); if (CurrentControllerState > (int)oController.Keyboard) { CurrentControllerState--; } else { CurrentControllerState++; } if (Game1.Sound == true) menu_przeskok_sound.Play(); } if ((keyboardState.IsKeyDown(Keys.Right) || keyboardState.IsKeyDown(Keys.Left))&& CurrentOptionsState == (int)oMenu.Sound) { Thread.Sleep(100); if (Game1.Sound==true) { Game1.Sound = false; } else { Game1.Sound = true; } if (Game1.Sound == true) menu_przeskok_sound.Play(); } graphic.Grafika_Menu2(spriteBatch, CurrentOptionsState,CurrentControllerState, gameTime, Game1.Sound); if (keyboardState.IsKeyDown(Keys.Escape)) { Thread.Sleep(50); Game1.GameState = Game1.Stan.Menu; } }
public void Menu_Credits(KeyboardState keyboardState, SpriteBatch spriteBatch, GraphicsDevice GraphicsDevice, Graphic graphic, GameTime gameTime) { if (menu_Credits.State != SoundState.Playing) { if(Game1.Sound==true) menu_Credits.Play(); } if (keyboardState.IsKeyDown(Keys.Escape)) { Game1.GameState = Game1.Stan.Menu; x = 190; y = 745; if (menu_Credits.State == SoundState.Playing) menu_Credits.Stop(); } else { if (y > -330) { y--; } else { y = 745; } keyboardState = Keyboard.GetState(); graphic.Grafika_Credits(spriteBatch, gameTime, x, y); } }