F103 — Game Loading Screen
Business Rule
Every game client must display a branded loading screen with a visible progress indicator while assets are being downloaded. The loading screen must:- Appear immediately on page load (before any game content is visible)
- Show a progress bar that advances in real time as assets load
- Dismiss automatically and cleanly when the game is ready to play
- Never leave the player looking at a blank or partially-rendered screen
Technical Design
Each client implements the loading screen differently to suit its rendering architecture:v4 — JS / Phaser 2
Phaser 2 sprite-based two-stage state machine:- BootState loads the loading background image and bar sprites
- PreloadState calls
this.load.setPreloadSprite(preloadBar)— Phaser auto-clips the bar width as assets load - Transitions to GameRun when
load.onLoadCompletefires
v5 — UMA / GDK
HTML/CSS overlay injected before the GDK wrapper:- Shown immediately on page load
- XHR intercept: wraps
window.XMLHttpRequestto count in-flight vs completed requests; maps completion ratio to 30–88% of the bar - Slow drip: auto-increments toward 30% during synchronous JS script loading phase (no XHR trackable)
- Completion hook: patches
GDKLoader.showGameFrame()to fill bar to 100% then fade out (0.5 s opacity transition) - Original
XMLHttpRequestrestored after dismissal
v6 — Phaser 3 / TypeScript
Phaser graphics bar rendered insidePreloadScene, before GameScene starts:
PreloadScene.preload()creates a full-screen dark rectangle, logo text, track rectangle, and fill rectanglethis.load.on('progress', value => fill.setScale(value, 1))drives the bar in real timePreloadScene.create()transitions toGameScene— the loading graphics are destroyed automatically
v7 — Horse Race / HTML+CSS
HTML overlay onindex.html, dismissed on the hedgeem:ready custom event:
- Overlay shown from page load
hedgeem:readyis dispatched bysrc/main.tswhen the engine is initialised and the first game state is ready- On event: bar fills to 100%, overlay fades out (0.4 s)
- No asset XHR tracking needed — v7 has no significant async asset loads
v8 — Casino / HTML+CSS
Identical pattern to v7: HTML overlay dismissed onhedgeem:ready.