Hacker News new | past | comments | ask | show | jobs | submit login
Flappy Dird: Flappy Bird Implemented in MacOS Finder (eieio.games)
639 points by eieio on Oct 8, 2023 | hide | past | favorite | 57 comments



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.

Kudos to the author.


This is why I never say anything is impossible in software. It only takes time and creativity


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.


I wonder if anyone who gets Flappy Dird running at work is ever really likely to be 'in a rush'?


In a rush to leave work for beers??? Most definitely.


I would certainly hope that you can do this for years without the drive dying.


“this is an image; i have no idea how to embed a tweet anymore”

I actually much prefer this.


Also, this will make the post persistent. With an embed, a post can disappear/break any time.


i really like the fact it is one less 3rd party JS library that grants the 3rd party who knows what access to what data of the user


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.


Oh I had no idea - thanks! I’ll play around with that.

V cool to get two super helpful AppleScript comments in 5 minutes!


Have you considered using py-appscript to trigger AppleScript events natively from Python?

https://github.com/hhas/appscript/tree/master/py-appscript

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)


If you enjoy this kind of "games in places they shouldn't be" thing, here's some more very silly projects:

- Fontemon: a game in a font https://www.coderelay.io/fontemon.html

- Dungeons & Directories: a text adventure in your file browser https://wheybags.com/dungeons_and_directories/ (disclaimer: I made this one)


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.

[1] http://eieio.games/nonsense/hexagone-converting-hex-to-rgb-w...


See also Defender of the Favicon: http://www.p01.org/defender_of_the_favicon/


The way you did the second is ingenious! Did you consider implementing it with FUSE instead?


There's also rpg-cli for the command line nerds.

https://github.com/facundoolano/rpg-cli


What eldritch magic is this…


I love the "we can do better" attitude through the post. Imagine if all developers had this mindset!

Of course if we all did, then nothing would ever get done because we could always do better. Sometimes you need someone to say "this is good enough".


Ha! You're right that it can be a hard balance.

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...)


Next challenge: Run Game of Life in Finder emulating a Mac running Finder.


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.


...Everyone's just too dumbfounded to comment


Ad placement starts at $2000


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.

Thanks for sharing!


This is a cool hack, but it uses the Finder/file system as a graphics system, but isn’t really implemented in it.

When I read the title, I expected it to use folder actions (https://developer.apple.com/library/archive/documentation/La...) to obtain user input.

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?


What a wonderful work of art!


It is a matter of time until someone does it with the "Bad apple" music video.


With 4 FPS, it would definitely look great


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.

(no idea if that’s enough to look ok)


10 fps is definitely good enough


You can, or could, merge AppleScript and ObjC too. https://developer.apple.com/library/archive/releasenotes/Scr...

“ Using AppleScriptObjC, your AppleScript code can work with any Cocoa framework, and can function as a first-class citizen in the Cocoa world.”

It’s been a long time since I had to, but you could but all your code into a single app, if you could port the python to ObjC.


These are the kind of weird experiments that keep me coming back to this site. Amazing.


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"

[0]: https://www.youtube.com/playlist?list=PLsTVaNk5lQHmRy51gyAsV...


That's... a thing. I am filled with awe.


What a wonderful experiment! My favorite type of posts on HN.


The creativity of the human mind knows no bounds - well done


wow

> ...Everyone's just too dumbfounded to comment

So true.


Todo: DOOM


Hahaha this is incredible. Amazing work. How does this affect system resources in terms of cpu and memory usage?


Absolutely amazing, well done!


This is the dumbest thing and I love it to death. +1000000 internet points .


A labor of love, a crazy idea and well executed. Congratulations


This is phenomenal!


Definition of a “hacker”


Is Finder Turing complete?


Wow bravo!


Finder emblem?


FINALLY!


“I rewrote it in AppleScript for speed.”


Creative but ultimately a dog whistle. "What are the limit of MacOS GUI?" shouldn't be novel.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: