Monday, September 7, 2015

recreational programming and the geekiest of nostalgia

In my blog going over old COMPUTE!'s Gazettes, I found a game I remembered, kind of an odd breakout variant, called "Whirlybird". I remember being fascinated by the construction of its main sprite, a kind of spinning bird statue thing with a neat 3D feel. And more specifically, I remembered finding out that if I loaded the game then quit it and loaded the sprite editor Sprite Magic, I could see the 11 frames that went into its rotation, one at a time:
I decided I would get in touch with my middle school self and make an Animated GIF of the thing. The challenge was, even when I set the Commodore emulator to not have any fake-y video artifacts, I couldn't get a pixel-perfect unaliased version of the sprite that I could just slam into ImageMagick.

The safest route seemed to be to make 11 Sprite Magic screenshots, read them one at a time into Processing, and pluck the screen center pixel for each square in the actual sprite editor. I had my screenshot reader generate a series of function calls that recreated each frame in something like ASCII art:
doFrame(
"_________####___________"+
"___________##___##______"+
"_______#___##__####_____"+
"_____#####_##_######____"+
"____################____"+
"___###___######___###___"+
"___##_____####_____##___"+
"__________####__________"+
"___________##___________"+
"___________##___________"+
"__________####__________"+
"");

(I also generated a
setFrames(24,11);
line that the receiving program could use to know the width and height of each mini-ASCII masterpiece.)

At this point I was able to make a second, semi-reusable program to convert the series of frames into a GIF, using the excellent GifAnimation library that is just a few clicks away from Processing's builtin Library manager.

Here is the final result:

To a normal person this might not seem like a worthwhile use of a few hours, but perhaps my fellow nostalgic geeks will understand...

Anyway, here is the pixel plucker program "whirlybirder" and its companion whirlybirder2:Ascii2GIF.

No comments:

Post a Comment