Skip to content

Instantly share code, notes, and snippets.

@gazsp
Created August 31, 2025 09:52
Show Gist options
  • Select an option

  • Save gazsp/cceef35ed68b0a2db7fbb5935213830f to your computer and use it in GitHub Desktop.

Select an option

Save gazsp/cceef35ed68b0a2db7fbb5935213830f to your computer and use it in GitHub Desktop.

Revisions

  1. gazsp created this gist Aug 31, 2025.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    // Reverse order every other frame to flicker sprites
    if (++frame & 1) {
    address2 = (u16)&entities;
    for(i=1; i<MAX_ENTITIES; ++i) {
    e = (Entity*)address2;
    processEntity();
    address2 += sizeof(Entity);
    }
    }
    else {
    address2 = (u16)&entities[7];
    for(i=MAX_ENTITIES-1; i != 0; --i) {
    e = (Entity*)address2;
    processEntity();
    address2 -= sizeof(Entity);
    }
    }