Loading Screen - UQdeco2800/2022-studio-3 GitHub Wiki

What does the Loading Screen load?

The Loading screen loads the assets required for the AtlantisGameArea in 10ms bursts until all assets are loaded.

Timeline of loading screen

After the player finishes/skips the tutorial screen, the loading screen is instantiated to load the main games assets. After assets are loaded, the main game screen is instantiated. This means you should always switch the the loading screen before the main game screen so that the assets are loaded for the main game

What it looks like

Screenshot 2022-10-01 140756

How the loading Screen is created and loads assets

Just like the main game screen, it initialises the Service Locator and all it's services. The loading screen then queues all the assets in the Resource Service that need to be loaded. LoadingScreen_new

The loading screen then creates a LoadingBar.java. The LoadingBar.java then loads the assets for 10ms burst and draws to the screen the progress.

    @Override
    public void update() {
        logger.info("Loading... {}%", ServiceLocator.getResourceService().getProgress());
        if (ServiceLocator.getResourceService().loadForMillis(10)) {
            loaded = true;
        }
    }

Creation of Loading Bar

Sequence Diagram showing how the loading bar is created: As a UIComponent, it creates an Image from an asset for the loading bar frame and the loading bar texture. LoadingBar_create