/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public override void Update(GameTime gameTime) { // pheonomina the keyboard states are mapped to getstate backgroundkey = Keyboard.GetState(); buttonengine.Update(gameTime); buttonengine.ReceiveFrom_ButtonObject(buttonobject.gogobuttonrect); buttonobject.ReceiveFrom_ButtonEngine(buttonengine.SendTo_ButtonObject()); #region ChosenBackground KeyboardKeys if (backgroundkey.IsKeyDown(Keys.D0)) { chosenbackground = ChosenBackground.background1; } if (backgroundkey.IsKeyDown(Keys.D1)) { chosenbackground = ChosenBackground.background2; } if (backgroundkey.IsKeyDown(Keys.D2)) { chosenbackground = ChosenBackground.background3; } if (backgroundkey.IsKeyDown(Keys.D3)) { chosenbackground = ChosenBackground.background4; } if (backgroundkey.IsKeyDown(Keys.D4)) { chosenbackground = ChosenBackground.background5; } if (backgroundkey.IsKeyDown(Keys.D5)) { chosenbackground = ChosenBackground.background6; } if (backgroundkey.IsKeyDown(Keys.D6)) { chosenbackground = ChosenBackground.background7; } if (backgroundkey.IsKeyDown(Keys.D7)) { chosenbackground = ChosenBackground.background8; } if (backgroundkey.IsKeyDown(Keys.D8)) { chosenbackground = ChosenBackground.background9; } if (backgroundkey.IsKeyDown(Keys.D9)) { chosenbackground = ChosenBackground.background10; } // TODO: Add your update logic here #endregion texttospeechengine.Update(gameTime); texttospeechobject.ControlledBy_TextToSpeechEngine(texttospeechengine.Controlling_TextToSpeechObject()); if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.A)) { reading = Reading.place; } else if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.S)) { reading = Reading.title; } else if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.D)) { reading = Reading.phonenumber; } else if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.F)) { reading = Reading.website; } else if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.G)) { reading = Reading.explination; } else if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.Left)) { ScreenManager.Instance.AddScreen(new CampusInformationCenter()); } if (Reading.place == reading) { texttospeechengine.ReceiveFrom_TextToSpeechObject(place); reading = Reading.nothing; } else if (Reading.title == reading) { texttospeechengine.ReceiveFrom_TextToSpeechObject(title); reading = Reading.nothing; } else if (Reading.phonenumber == reading) { texttospeechengine.ReceiveFrom_TextToSpeechObject(phonenumber); reading = Reading.nothing; } else if (Reading.website == reading) { texttospeechengine.ReceiveFrom_TextToSpeechObject(website); reading = Reading.nothing; } else if (Reading.explination == reading) { texttospeechengine.ReceiveFrom_TextToSpeechObject(explination); reading = Reading.nothing; } //////////////////////////////////// //texttospeechengine.ReceiveFrom_TextToSpeechObject(spokenidnumberarray); ////////////////////////////////////// }
public override void Update(GameTime gameTime) { #region JESUS IS LORD SOUND REPEATING JESUS IS LORD! if (MediaPlayer.State == MediaState.Stopped) { MediaPlayer.Play(backgroundMusic); } #endregion forward.Update(gameTime); scrollingbackgroundtop.Update(gameTime); scrollingbackgroundbottom.Update(gameTime); backwards.Update(gameTime); #region JESUS IS LORD CHARACTER CONTROL ALGORITHIMS /* * if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.G)) * { * gokuRect.X = gokuRect.X + 1; * * * redRect.X = redRect.X + 2; * * } * * if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.S)) * { * supermanRect.X = supermanRect.X - 1; * blueRect.X = blueRect.X - 2; * } * * keyState = Keyboard.GetState(); * * if ((gokuRect.X - 250) >= (supermanRect.X)) * ScreenManager.Instance.AddScreen(new TitleScreen()); * if (displayEndScenes) * { * if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.D3)) * { * ScreenManager.Instance.AddScreen(new GokuWins()); * } * * if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.D4)) * { * ScreenManager.Instance.AddScreen(new SuperManWins()); * } * * } */ #endregion if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } if (hitboxrect[0].Intersects(leapcollisionb)) { broken[0] = true; hitsound.Play(); } #region JESUS IS LORD AND IN CONTROL - THIS CHANGES STATE TO THE OPENING VIDEO if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.Enter)) { MediaPlayer.Stop(); //ScreenManager.Instance.AddScreen(new SplashScreen()); ScreenManager.Instance.AddScreen(new ChangingBackgroundState()); } #endregion #region Login Screen Update algorithims idkey = Keyboard.GetState(); // || idkey.IsKeyDown(Keys.D1) || idkey.IsKeyDown(Keys.D2) || idkey.IsKeyDown(Keys.D3) || idkey.IsKeyDown(Keys.D4) || idkey.IsKeyDown(Keys.D5) || idkey.IsKeyDown(Keys.D6) || idkey.IsKeyDown(Keys.D7) || idkey.IsKeyDown(Keys.D8) || idkey.IsKeyDown(Keys.D9)) if (idkey.IsKeyDown(Keys.Space)) { hitkey = false; } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D0)) { hitkey = true; idnumber[idnumberplace] = '0'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D1)) { hitkey = true; idnumber[idnumberplace] = '1'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D2)) { hitkey = true; idnumber[idnumberplace] = '2'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D3)) { hitkey = true; idnumber[idnumberplace] = '3'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D4)) { hitkey = true; idnumber[idnumberplace] = '4'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D5)) { hitkey = true; idnumber[idnumberplace] = '5'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D6)) { hitkey = true; idnumber[idnumberplace] = '6'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D7)) { hitkey = true; idnumber[idnumberplace] = '7'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D8)) { hitkey = true; idnumber[idnumberplace] = '8'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } if (hitkey == false) { if (idkey.IsKeyDown(Keys.D9)) { hitkey = true; idnumber[idnumberplace] = '9'; idnumberplace++; if (idnumberplace >= 10) { idnumberplace = 1; } } } // } texttospeechengine.Update(gameTime); texttospeechobject.ControlledBy_TextToSpeechEngine(texttospeechengine.Controlling_TextToSpeechObject()); if (idnumberplace == 9) { //texttospeechengine.ReceiveFrom_TextToSpeechObject(); words = new string(idnumber); spokenidnumberarray[0] = words; texttospeechengine.ReceiveFrom_TextToSpeechObject(spokenidnumberarray); idnumberplace++; //spokenidnumberarray } #endregion }