Exemplo n.º 1
0
        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
        }
        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
        }