Skip to content

fix: resolve missing textures and frame count errors in Phaser#24

Merged
Jing-yilin merged 1 commit into
mainfrom
hotfix/fix-missing-textures
Mar 25, 2026
Merged

fix: resolve missing textures and frame count errors in Phaser#24
Jing-yilin merged 1 commit into
mainfrom
hotfix/fix-missing-textures

Conversation

@Jing-yilin
Copy link
Copy Markdown
Contributor

Problem

Two Phaser console errors on the live site (agentworlds.ai/w/super-office-g3ql):

  1. Frame "48" not found in texture "star_idle" -- off-by-one in frame count calculation
  2. Texture "coffee_machine" not found -- asset filenames in game.js don't match actual files on disk

Root Cause

  • star_idle frame error: starIdleFrameMax was computed as frameTotal - 1, but Phaser's frameTotal includes the __BASE frame. For a 48-frame spritesheet, frameTotal is 49, so 49 - 1 = 48 is out of range (valid: 0-47). Should be frameTotal - 2.
  • coffee_machine not found: game.js referenced old unversioned filenames (coffee-machine-spritesheet, star-idle-spritesheet, etc.) that don't exist on disk. The actual files use versioned names (coffee-machine-v3-grid.webp, star-idle-v5.png, etc.).

Changes

  • Fix starIdleFrameMax calculation: frameTotal - 1 -> frameTotal - 2 in index.html and electron-standalone.html
  • Update all asset references in game.js to match actual versioned filenames on disk
  • Use dynamic frame counts (frameTotal - 2) instead of hardcoded values
  • Remove references to non-existent assets (star-researching-spritesheet, sofa-busy-spritesheet, desk-v2.png)
  • Align error_bug frame size to 220x220 (matching index.html)

- Fix star_idle frame 48 not found: change frameTotal - 1 to frameTotal - 2
  (Phaser's frameTotal includes __BASE frame, causing off-by-one)
- Fix coffee_machine texture not found: update filename from
  coffee-machine-spritesheet to coffee-machine-v3-grid.webp
- Update all game.js asset references to match actual versioned filenames:
  star-idle-v5.png, sofa-idle-v3.png, desk-v3, sync-animation-v3-grid,
  flowers-bloom-v2, error-bug frame size 220x220
- Use dynamic frame counts instead of hardcoded values for animations
- Remove references to non-existent assets (star-researching-spritesheet,
  sofa-busy-spritesheet, desk-v2.png)

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@Jing-yilin Jing-yilin merged commit 3a6af41 into main Mar 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant