Protect rendering performance
For a technical producer, this purchase recovery prototype should make every player action and result the player can inspect easy to evaluate. Write how to handle reloads, interrupted delivery, duplicate clicks, and insufficient Koin without double granting. Map preview, confirmation, a player cancellation, not enough Koin, pending, success, delivery, owned, and reload. Give every failure a safe next action. Open and close the interface during GPU-heavy scenes, then monitor input, frame pacing, and canvas recovery. A commerce overlay should not leave the game loop paused or controls captured unexpectedly.
Coordinate DOM and canvas state
Make the selected item and outcome visible in both interface and gameplay context. Handle focus loss, pointer lock, fullscreen transitions, and a resized canvas around confirmation and return.
Exercise context recovery
Simulate refresh, background suspension, and a lost rendering context. The player-facing purchase result should reconcile separately from graphics recovery and must never duplicate an item.
Name every state and owner
Separate preview, confirmation, pending, success, delivery, owned, insufficient Koin, cancel, interrupted, and reopened states. Assign later production work for identity, persistence, native billing, security, refunds, policy, and monitoring.
Define idempotent recovery
Repeated confirmation, a slow response, navigation during delivery, and reopening must resolve to one result. Record which state is authoritative and how the player can safely retry without another grant or Koin deduction.
Turn the prototype into tickets
Capture the visible behavior first, then create implementation tasks with expected examples for each transition and platform boundary. Do not translate a working browser interaction into an unsupported claim that backend commerce is complete.
Keep pending understandable
If delivery is interrupted, explain whether the result is pending, safe to retry, or already complete. Do not show both failure and success. Test that behavior using WebGL games. WebGL rendering and commerce state need separate failure testing.
Make retry idempotent
Repeated clicks and reloads should resolve to one purchase result. The player must never receive duplicate items or lose Koin twice. Test that behavior using WebGL games. WebGL rendering and commerce state need separate failure testing.
Return to a safe game state
Cancelling the action, an insufficient balance, and recoverable errors should preserve progress and offer a clear return or retry action. Test that behavior using WebGL games. WebGL rendering and commerce state need separate failure testing.