loading-assets

Load external game assets into Phaser 4 global caches.

1|Updated May 3, 2026
One-click install
npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill loading-assets-wandertheweeb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loading-assets
Source: https://github.com/WanderTheWeeb/papas_trauma/tree/main/skills/loading-assets
Command: npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill loading-assets-wandertheweeb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of reliably loading and organizing external assets in Phaser 4 so they’re ready when gameplay starts, including tracking load progress and handling load-time errors.

Core Features & Use Cases

  • Preload-safe asset loading: Queues assets in preload() and guarantees they’re available by create(), preventing “undefined texture/data” bugs.
  • Loader configuration and correct URL/caching behavior: Manages baseURL, path, and prefix so assets resolve correctly and cache keys are referenced consistently across scenes.
  • Progress, completion, and error handling: Uses Loader events (like progress, complete, and loaderror) to build loading screens and diagnose failures.

Use case: You’re building a level-select flow where each level has its own images, sprite sheets/atlases, audio, JSON, and tilemaps; use this Skill to load everything during scene preload() while showing an accurate progress bar and failing gracefully if any file can’t be fetched.

Quick Start

Add your asset loading calls to a Phaser Scene’s preload() method and then read the cached assets in create() after the Loader finishes.

Frequently Asked Questions about loading-assets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load images and audio in Phaser 4 so they are ready by create()?

Use the Phaser Loader queue in preload() to load images, audio, and JSON so they are cached and ready by the time create() runs. This preload-safe workflow prevents undefined texture or data bugs during gameplay.

How do I show an accurate progress bar when loading Phaser game assets?

Attach listeners to Phaser Loader events like progress and complete to build a loading screen. This tracks asset loading status in real-time and triggers UI updates as files load into the cache.

Why are my Phaser sprite sheets and JSON tilemaps showing undefined texture errors?

Undefined texture errors occur when assets are not properly queued in preload() or cache keys are mismatched. Ensure correct URL resolution via baseURL and path, and reference the exact cache keys when accessing textures in create().

Can I load Phaser assets on-demand instead of only during scene preload?

Yes, Phaser supports on-demand asset loading workflows alongside preload-time loading. You can trigger the Loader outside of preload() to fetch additional images, audio, or JSON tilemaps and add them to global caches at runtime.

How do I handle load failures when fetching external Phaser assets?

Listen to the loaderror Loader event to detect failed asset fetches and handle them gracefully. This allows your game to catch missing images or audio files during preload and show fallback content without crashing.

Do I need to configure baseURL and path for Phaser loader to resolve asset URLs correctly?

Configuring baseURL, path, and prefix ensures the Phaser Loader resolves external asset URLs correctly and maintains consistent cache keys across scenes. This setup prevents file resolution failures when loading images, atlases, and JSON tilemaps.