I don't have much to say, because I am at a loss for words. I like to think of myself as an "out of the box" thinker, but if someone had asked me if this was possible before reading this, I would have said it isn't.
I absolutely love seeing projects that people put together on a weekend just to challenge themselves and see if something is possible. This is an amazing feat, thoroughly enjoyed the write up.
In a rush to catch up with his team heading out for friday afternoon beers, Bob grabs his jacket and backpack and fails to notice he left Flappy Bird Implemented in MacOS running. It's a bank weekend. Bob doesn't know it, but his laptop SSD write cycles are being eaten up at a rate of 4 frames per second. Bob returns on Tuesday to find his SSD drive no longer works.
Agreed! After blocking Twitter I either see nothing where an embed is supposed to be, or only see emojis rendered in the middle of an otherwise blank area.
I wonder if OP can solve the AppleScript startup speed problem by rewriting it in… JavaScript? For half a decade now the underlying framework and the command-line tool (osascript) support AppleScript and JavaScript equally well. In JS there are simply a lot of things in the $ object.
I’ve only ever used the Ruby version of Appscript to be honest, but if the Python version works the same way it would seem to be ideal and would obviate the need for AppleScript entirely.
Oh my goodness I didn’t even think to check if something like this existed! I will certainly check it out (although I do get a bit of delight from the core loop being AppleScript)
Ah thanks for both links! Fun to see that you also chose the filesystem :). Excited to check it out when I am back at a windows machine in a few weeks.
I actually played a bit with font games and wrote Hexagone[1] to see what writing a font was like. I didn’t leave the experience that sure what game to build so it’s fun to have some inspiration.
I think it's easier to stay on the "we can do better" track when working on a hobby project like this. At work I'm typically thinking about whether a marginal day spent polishing something is worth more than all the other stuff that we want to do.
But with Flappy Dird I knew that I wanted to push until I was either happy with the project or didn't believe that I could push the game any more.
My first thought upon reading the title was that it would be done in icon view, using AppleScript to move the icons around within a Finder window like sprites. I was surprised to see it done in list view and (initially) polling the directory "last opened" date—definitely a creative approach.
TFA's spirit of bringing little games everywhere they can brings me so much joy. It reminds me of the old Fortune Teller fish taskbar widgets you could get in earlier GNOMEs.
(On an entirely unrelated note, the capitalization "MacOS Finder" made me think first that this was an extension for MacOS 8 or 9, but this is a lot more delightful...)
I wonder if you could do this with DS_Store files (not the emulating MacOS, but just the game of life thing), so initially you make some new folders in a pattern, right click, align. (So it's all on a grid)
Then run the script, it reads the position of folders from the DS_Store file, updates it with the new positions of the next frame of folders, or creates/delete folders if needed.
I've been using AppleScript since its beginnings in combination with all kinds of other scripting tools and system components for all kinds of more or less useful things, and I'm really happy to it being used like this even 30 years later.
My first implementation was using my first Mac's speech recognition to implement an interactive chistmas calendar, btw. So this was a nice reminder of that.
That, IMHO, would be slightly more “implemented in MacOS Finder”
It might be too slow but you could, for example, have the user drag a window around as the game controller, and have the main game loop create a file in a directory to trigger a folder action that runs the main game loop again.
Also, can’t you avoid the AppleScript startup problem with a stay-open AppleScript that you send events?
fwiw without any interaction I think I could push this to something like 10 FPS! Just can’t do that here since you can’t accept input during the AppleScript Finder calls.
I wonder if you could do this using fuse as well. Have directory read act as a "jump". No apple script required and could work outside of OSX as well, as long as the frontend shows the directory contents properly.
I am absolutely delighted by stuff like this.
The fact that this all started by finding out there's an atime equivalent in finder is great.
Now i wonder, is there any way to react to arrow keys being pressed, or does finder allow you to use wasd to jump to specific files starting with those letters and react to that? That would extend the possibilities of games run in finder, and if you choose a game that only updates when pressing buttons, like rouge, you wouldn't even have to worry about the fps limit.
This reminds me of the excellent "Bad Apple!!" series[0] from Junferno, who is an excellent CS video creator. Specifically "Bad Apple!! played on Windows 10 File Explorer"
I absolutely love seeing projects that people put together on a weekend just to challenge themselves and see if something is possible. This is an amazing feat, thoroughly enjoyed the write up.
Kudos to the author.