← Back to Documentation Index

📦 Asset Loader

Loading and caching of images, sounds, and models

📋 Overview

The Asset Loader manages loading and caching of game resources including images, audio files, and 3D models.

💡 Asset Types
  • Images - PNG, JPG for sprites and textures
  • Sounds - MP3, WAV, OGG audio files
  • Models - GLB/GLTF 3D models
  • Caching - Automatic resource caching

📦 Asset Functions

loadImage(url)

Loads an image file.

url string - Path to image file
Returns: Promise - Promise resolving to image
Example:
const img = await loadImage("/sprites/player.png");
loadSound(url)

Loads an audio file.

url string - Path to audio file
Returns: Promise - Promise resolving to audio
Example:
const sfx = await loadSound("/sounds/jump.mp3");