Quick answer: Pygame Zero games loading sprites that don't exist without errors? Default error mode is lenient - enable strict mode or validate asset paths at startup.

Typo'd a sprite name. Game renders a default rect instead of erroring. Bug ships to players.

Validate at startup

for name in REQUIRED_ASSETS:
  assert os.path.exists(f"images/{name}.png")

Manual; catches typos before game state.

Use the strict images flag

Pygame Zero 1.3+ has --strict. Missing images become errors instead of warnings.

Test asset names

Unit test that loads every named asset. Failing names surface; refactors stay safe.

“Lenient error modes hide bugs. Strict modes surface them.”

Make strict mode the default in your dev workflow. Ship in lenient mode only if you have a strong reason; document the reason.

Related reading