I finished Flappy Dird! I thought I'd spend a little time talking about how it works.
If you want all the deets you can read my blog about it here or go poke at the code here. But the gist is:
- Maybe obvious based on the gif but: you can put emojis in filenames and finder will display them. This is useful because it's hilarious, but also because it makes drawing to the finder window way easier since spacing is consistent.
- The directories that the game is played in contain a ton of files (that we give emoji filenames). Those files are actually symlinks to their parent directory - so double clicking on them doesn't change the directory that you're in.
- MacOS has a "last opened" timestamp that updates when you open a directory in Finder - this means that we can detect when you double-click one of the symlinked files by repeatedly accessing the last opened timestamp (which is accessible via
mdls). - To detect "taps" we use AppleScript, which can get the number (if any) of files currently selected in a Finder window.
- To make double buffering work we also use AppleScript, which can tell Finder to change the directory that it's currently displaying. We alternate between showing buf1 and writing to buf2 and vice-versa. This matters a ton - without it there's a bunch of screen tearing.
- AppleScript startup speed is awful (like 0.2 seconds or something) so the core game loop is a tiny bit of AppleScript that shells out to Python for the game logic.
I think that is most of the trickery!

🏳️⚧️