[Beginner] Need Help! (Change Images on Sprites)

Try a table of pending sprite image changes, serviced by a clock.

Normally empty, the table would be given a new row for a pending sprite image change with

  • SystemTime when it should happen (future)
  • Sprite component
  • Pending image

Each clock timer cycle, the clock checks the table for entries that are ripe, applies them, then removes them.

Do removes from high index to 1 by -1 to avoid index collapse.

This is good for lots of sprites.