コード例 #1
0
        protected override void Update(GameTime gameTime)
        {
            ImprovedKeyboard.Update();
            ImprovedMouse.Update();
            currentScene.Update(gameTime);

            HandleFullscreenSwitch();

            if (ImprovedKeyboard.DidJustPress(Keys.Q))
            {
                Exit();
            }

            if (currentScene is InfoScreen splash && splash.Continue)
            {
                if (isOnSplash)
                {
                    currentScene = new InfoScreen(GraphicsDevice, camera, "infoscreen");
                }
                else
                {
                    currentScene = new GameScene(GraphicsDevice, camera);
                }
                isOnSplash = false;
            }

            base.Update(gameTime);
        }
コード例 #2
0
        public override void Update(GameTime gameTime)
        {
            if (GameState.GameOver)
            {
                return;
            }

            base.Update(gameTime);

            if (ImprovedKeyboard.DidJustPress(Keys.A))
            {
                FinishAllActions();
            }
            if (ImprovedKeyboard.DidJustPress(Keys.N))
            {
                NextDifficulty();
            }

            //if (!hasSetupStart)
            //    return;

            //activeContracts.RemoveAll(x => !x.IsInteractable);
            //activeHosts.RemoveAll(x => !x.IsInteractable);

            var playtime = (float)gameTime.TotalGameTime.TotalSeconds;

            if (playtime > currentLevel.levelTime)
            {
                NextDifficulty();
            }

            //if (activeContracts.Count < currentLevel.NumberOfContracts && contractTimer.Finished)
            //{
            //    AddContract();
            //}

            //var contractProcessingNeeded = activeContracts.Sum(x => x.ProcessingLeft * GameState.BrainProcessing);
            //var hostProcessingAvailable = activeHosts.Sum(x => x.VisitingTimeLeft * GameState.BrainProcessing);

            //if (contractProcessingNeeded > hostProcessingAvailable && hostVisitTimer.Finished)
            //{
            //    AddHost();
            //}
        }