sprite ai
Make the first flash cel survive a slow update
A one-frame flash announces that a gate has opened. If the effect is created during a slow game update, its timer can advance through several exposures before the player sees its first draw. A flash that looks reliable during normal play can vanish when the scene loads.
Set up an acceptance case with three visibly numbered cels. Trigger the effect from another update callback and deliver a synthetic 500 ms delta on that step. Check which cel the first draw actually selects. Repeat with the same total elapsed time spread across smaller steps. The first image should agree between those runs when it carries a gameplay cue.
The technical guide and test fixture captures Pygame Zero 1.2.1 passing a single tick’s delta to both the old callback and a fresh callback registered inside it. It is a concrete reason to establish when newly created effects enter the update list.
For essential cues, give the effect a first-draw flag and start its local exposure timer at the committed draw or after the designated update boundary. If the effect is decorative and allowed to catch up, record that separately. Keep the playback rule alongside the sheet so runtime changes can be checked with the same numbered cels.
Prepared by the FrameSprite Workflow Team with AI assistance. Examples are illustrative unless attributed to a linked fixture.