Пример #1
0
        protected override void Update(GameTime gameTime)
        {
            float dt = (float)gameTime.ElapsedGameTime.TotalSeconds;

            setGameState(dt);
            Input.Update(renderer.Cam);
            controllers.Update(dt, gameState);
            base.Update(gameTime);
        }
Пример #2
0
        public override bool Update(float dt)
        {
            DayOfWeek = world.DayOfWeek;
            setGameState(dt);
            Input.Update(gameState);
            if (gameState == GameState.Playing)
            {
                controllers.Update(dt);
            }

            // Swap screen?
            if (Input.MainMenu)
            {
                GoToLevelSelect = true;
                return(true);
            }
            if (levelOverTimer >= LevelOverLength)
            {
                // Win
                if (world.Enemies.Count == 0)
                {
                    NextLevel = true;
                }
                else
                {
                    RestartLevel = true;
                }
                return(true);
            }
            if (Input.Restart)
            {
                RestartLevel = true;
                return(true);
            }

            return(false);
        }