public override void Update(GameEngine engine, GameTime gameTime)
        {
            if (_firstRun)
            {
                List <Asset.Asset> assetsToLoad = AssetRegistry.GetAssetsToLoad();
                AssetLoader.LoadQueue.AddAll(assetsToLoad);

                _totalAssetsToLoad = AssetLoader.LoadQueue.GetSize();
                _currentlyLoaded   = 0;
                _loadedEverything  = _currentlyLoaded == _totalAssetsToLoad;
                _firstRun          = false;
            }
            if (!_loadedEverything)
            {
                AssetLoader.LoadQueue.LoadNext();
                _currentlyLoaded++;
                _loadedEverything |= _currentlyLoaded == _totalAssetsToLoad;
            }

            if (!IsAssetLoaded())
            {
                return;
            }

            MapTileTextures.Initialise();
            PlayerUnitAssets.Initialise();

            engine.EnterState(StateId.Gameplay);
        }
Ejemplo n.º 2
0
        internal static void Render(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, ClientMapTile tile, float x, float y)
        {
            SpriteAnimation tileAnimation = MapTileTextures.GetById(tile.Id);

            renderer.Render(tileAnimation, x, y, offsetY: tile.HeightOffset);
        }