protected override void Update(GameTime gameTime) { KeyboardState current_ks = Keyboard.GetState(); if (mission1.missionReset == true) { this.Components.Remove(mission1); mission1 = new Mission1(this, spriteBatch); this.Components.Add(mission1); hideAllScenes(); mission1.show(); } int selectedIndex = 0; if (startMenu.Enabled) { if (selectedIndex == 0 && current_ks.IsKeyDown(Keys.Enter) && previous_ks.IsKeyUp(Keys.Enter)) { //DEPLOY startMenu.hide(); mission1.show(); } previous_ks = current_ks; } base.Update(gameTime); }
private void Awake() { if (instance == null) { instance = this; } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); //scenes startMenu = new StartMenu(this, spriteBatch); mission1 = new Mission1(this, spriteBatch); this.Components.Add(startMenu); this.Components.Add(mission1); hideAllScenes(); cobraTheme = Content.Load <SoundEffect>("Themes/cobratheme"); startMenu.show(); cobraTheme.Play(); }