Esempio n. 1
0
        internal Game()
        {
            _player       = new Player();
            _currentScene = CrossRoad.Generate(_currentStage, _player);

            _testValue         = new LevelValue <double>(1000);
            _testValue.Current = 0;
            _testBar4          = new ProgressBar(_testValue, new Point(10, 51), 90, Color.WhiteSmoke);
            _testBar           = new ProgressBar(_testValue, new Point(10, 45), 10, Color.BlueViolet);
            _testBar2          = new ProgressBar(_testValue, new Point(10, 47), 20, Color.RosyBrown);
            _testBar3          = new ProgressBar(_testValue, new Point(10, 49), 60, Color.GreenYellow);
        }
Esempio n. 2
0
        public void OnUpdate([NotNull] GameTime gameTime)
        {
            Global.CurrentScreen.Clear();

            _testValue.Current += 5;
            _testBar.OnUpdate(gameTime);
            _testBar2.OnUpdate(gameTime);
            _testBar3.OnUpdate(gameTime);
            _testBar4.OnUpdate(gameTime);

            if (Math.Abs(_testValue.Current - _testValue.Maximum) < 0.0001)
            {
                _testValue.Current = 0;
            }

            if (!_currentScene.IsCompleted)
            {
                _currentScene.OnUpdate(gameTime);
            }
            else
            {
                _currentScene = CrossRoad.Generate(_currentStage++, _player);
            }
        }