Entries in the ‘Flash’ Category:

Double Pendulum Simulation

I’ve been playing around with some of the new features in HTML5, particularly to see how the canvas stacks up to Flash. One of the things I wanted to test was javascript performance, so I ported this Flash toy I wrote a few years ago. It’s a physical simulation of a double pendulum system. It’s interactive, and it can export the line drawing it produces as a PNG.

How did canvas+JS do? The export was a lot easier: I had to write a PNG encoder in Actionscript for the original version! Pretty much everything else was harder. Canvas has features similar to Flash 5, and I missed modern Flash’s rich standard library. CSS layout is still somewhat inferior to Flex for GUI design, as the layout options are less flexible.

One of the appeals of canvas is mobile support, but I was disappointed by the performance on my Motorola Droid. Just clearing the background on a canvas larger than 500×200 took the frame rate to single digits, and I couldn’t find a reliable way to make the canvas fill the screen if other elements were present (I didn’t look too hard, since a canvas that large was unusable). The javascript performance was fine, it was just the drawing that caused problems. Let me know if you get better results on different hardware, I’d love to know that this can work better.

Overall, canvas shows promise, but I don’t think it’s ready to replace Flash for complex graphical applications.

Tags: , , , ,

Leave a Comment


Spin: The Game

Spin is a new Flash game I’ve been noodling on for a little while. It’s a Puzzle Bobble type game, except that the balls can freely spin like a pinwheel. The rotation is physically accurate, so as balls fall off of the board it changes speed and direction. When a ball hits the board the ball’s momentum is transferred to it, so if the board is turning slowly you can speed it up or make it turn the other way by firing the balls at it.

The feature list was miles long, but I’m getting too busy to work on it. Look forward to a second version when I can get back to it.

Tags: ,

Leave a Comment


Better billboarding in Papervision3D

The Papervision3D wiki has an example for making billboarded sprites with just three extra lines of code. Trouble is, it doesn’t really work. Anyone who’s tried it may have noticed that when the planes get too close to the camera, or if the camera rotates around it’s z-axis at all, the planes start rolling instead of staying vertical.

The problem is that the lookAt method defaults to using the world y-axis as “up” for the billboards, which isn’t usually correct. Of course we don’t really care about the world y-axis with billboards. We just want them to be vertical in the camera. Here’s some code that does it.

// calculate the camera vertical in world coordinates
var up : Number3D = new Number3D(0, 1, 0);
Matrix3D.rotateAxis(camera.transform, up);

// billboard is the plane you want to billboard.
billboard.lookAt(viewpoint, up);
billboard.roll(180);
billboard.pitch(180);

Tags: , , , , , , ,

Comments (1)


Silly Jessica Simpson Game, Pizza Hut Codes

I don’t get it, but my wife loves the celebrity gossip, so when all this stuff about Jessica Simpson started coming out I whipped up this little game to make her laugh. It’s an homage to an old Mac game I haven’t seen in years called “Slick Willie.” I’m also keeping track of Pizza Hut’s sweepstakes codes here. Have fun.

Click on “more” to play the game.

Read the rest…

Tags: , ,

Comments (2)


Flash 9 in Linux

Those of you in the know already know that Adobe recently released Flash 9 for Linux. An official, honest to god, up to date version. The best part? It actually works.

I’ve had problems with Flash since I switched to Linux, because I foolishly chose the AMD64 version of Kubuntu. After messing around with a 32-bit chroot for awhile, I finally discovered Swiftfox, a version of Firefox compiled to use 32-bit libraries but optimized for, and compatible with, 64-bit systems. I could watch Flash movies again. Sound didn’t work, but who needs to hear them anyway? Oh, and since Macromedia never released Flash 8 for Linux, there were more and more SWF’s that I couldn’t watch. And it crashed the browser a lot.

Okay, so it totally sucked.

Even so, I was pretty disappointed after I upgraded to Swiftfox 2 and found that Flash stopped working. Imagine my surprise when I clicked on the missing plugin button and saw that Flash 9 was available. I knew Flash 9 for Linux was out, but I’ve never had the plugin search feature actually work correctly. Then, right before my eyes, Flash 9 installed, the page reloaded, and the SWF started playing. With sound. “Thus Spoke Zarathustra” came on the radio, the sun broke through the clouds of winter storms, and a chorus of angels heralded, or trumpeted, or whatever it is that choruses of angels do.

It’s almost as if big companies are starting to take Linux seriously.

Tags: , ,

Leave a Comment