At a party the other night, John Maloney was asking me whether I’d tried Dart. I had spent a bit of time with it back in May, but I realized that I hadn’t posted anything about it here. I figured that I’d better change that, so I went back and blew the dust off one of the programs I’d built then. I had to make a few changes because some libraries had been renamed, but they’d also made a number of improvements.
Here’s a copy of our old friend Planets and Ships. As in the original Processing version, you click to add ships which will fly around the planets. Let’s see how well this works for those of you who aren’t using Chrome.
You can also use the ‘c’, ‘s’, and space keys to create trails behind the ships and reset things.
There are four source files:
When you hit run, it pops up a copy of Chrome which connects to a local server it starts for you. The edit/debug cycle is nice and fast. I haven’t played with the Pub packaging tools yet because I’ve just been making little toy apps.
If you run into problems getting it to run in your browser, please drop me a line. Dart provides hooks for running in browsers other than Chrome, but I’m not sure that I’ve got them all set up correctly in this example.