Esempio n. 1
0
 public LevelRenderer(Level level)
 {
     _level = level;
     _worldRenderer = new WorldRenderer(_level.World);
     _playerRenderer = new PlayerRenderer(_level.Player);
     _gameClockRenderer = new GameClockRenderer(_level.GameClock);
     _starFieldRenderer = new StarFieldRenderer();
 }
Esempio n. 2
0
 public LevelController(Level level)
 {
     _level = level;
     _playerController = new PlayerController(_level.Player);
 }
Esempio n. 3
0
        private void LoadLevel()
        {
            if (_levelRenderer != null && base.IsLoaded)
            {
                _levelRenderer.Unload();
            }

            using (BinaryReader reader = new BinaryReader(File.OpenRead(_levelPath)))
            {
                _level = Level.Load(reader, _stage);
            }

            _level.World.CreatePortal(_level.World.GetStageStartIndex(_stage + 1));

            _level.Initialize();
            _levelRenderer = new LevelRenderer(_level);
            _levelController = new LevelController(_level);

            if (base.IsLoaded)
            {
                _levelRenderer.LoadContent();
            }

            _stageStartTime = _level.GameClock.RemainingTime;
        }