A developer has managed to create a functioning ping pong game on macOS’ dock, right beside a row of other icons.
Developer Neil Sardesai took to Twitter recently to share a video showcasing his ping pong game titled “Dock Pong” that lives and functions right on the macOS dock. It appears much like “pong,” the Apple Watch version of ping pong and functions similarly.
The paddle can be controlled by moving the cursor vertically through the dock beside the game’s placement.
At first glance, it appears like a simple macOS app icon, but when you see the paddles and the ball moving in Sardesai’s video, it seems fascinating and definitely demands the question: How?
Well, Sardesai took advantage of a class in Apple’s AppKit library called “NSDockTile.” According to official documentation provided by Apple, it’s “the visual representation of your app’s miniaturized windows and app icon as they appear in the Dock.”
NSDockTile is responsible for dynamically displaying the red notification badges that appear atop app icons on the dock. Neil took advantage of this class to implement a full-fledged pong game that you can play while you’ve some time to kill before a Zoom meeting, unlike other games which need to be explicitly accessed.
Ever since Neil shared his game, other developers have been climbing the bandwagon by sharing their own creative ways to use the NSDockTile class. A developer named Chris Jones, for instance, created a functional version of DOOM that can be played right on the dock.
It’s only time before more developers chime in. And that is when stuff might get even more interesting.
Let us know your thoughts in the comments section below.