Exemplo n.º 1
0
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            if (otherScreenHasFocus)
                return;

            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

            float seconds = (float)gameTime.ElapsedGameTime.TotalSeconds;

            Camera.Update(seconds);
            Camera.Translation.X = (float)(Math.Sin(gameTime.TotalGameTime.TotalSeconds * 0.3) * 50.0);
            Camera.Translation.Y = (float)(Math.Cos(gameTime.TotalGameTime.TotalSeconds * 0.3) * 50.0);

            if (leavingIntro)
            {
                fadingTimer -= seconds;
                if (fadingTimer <= 0.0f) fadingTimer = 0.0f;

                if (!Camera.IsShaking)
                {
                    VersusScreen versus = new VersusScreen();
                    //ScreenManager.AddScreen(versus, null);
                    LoadingScreen.Load(ScreenManager, true, null, versus);
                    versus.OnGameStarted();
                    leavingIntro = false;
                    //ExitScreen();
                }
            }
        }