• The Halton sequence: distributing points and exploring the universe

    Happy Dart 2.0 Launch! 🎆 I’ve been keeping busy lately with code for my Dart-based game engine, but I’ve had the idea for a fun little mathematical toy bouncing around in my head for a while now. I’m pleased to say that this weekend I finally had an opportunity to sit down and build it out. Although this simple app doesn’t do a whole lot to showcase any of the fancier features of the Dart language, it’s still pretty cool. Especially if you like nerdy things.

    Read on →

  • Animating an algorithm in Dart with asynchronous maze generation

    Since we’re on the topic of animation, I decided to give you another example HTML canvas app today. It’s an old favorite of mine: random maze generation. I’ll give you a brief overview of the maze generation algorithm, and then I’ll show you how I converted it into an animation using Dart’s asynchronous programming constructs.

    Read on →

  • It's alive! A more sophisticated web app with Dart

    Drawing stars and snakes and polygons is fun and all, but maybe you’re ready for a more substantial Dart example web app. This seems like a perfect time to implement a classic: Conway’s Game of Life. The app incorporates canvas-based animation, input from HTML controls, and a whole lot of other Darty goodness.

    Read on →

  • Simple interaction with HTML controls in Dart: Stellarator

    Lately I’ve posted one or two examples of very simple Dart web apps that draw graphics on an HTML canvas. Today’s example is another such canvas web app, but this time I’m also demonstrating how your Dart apps can interact with HTML elements–specifically controls on a web page. Behold the Stellarator, an app that draws stars. You can change the number of arms of the star, as well as their inner- and outer-radii. Here’s a screenshot.

    Read on →

  • Very simple web animation with Dart: Slithery

    In my last post, I gave you some example code for an extremely simple web app that draws some polygons on an HTML canvas element. Today I’m giving you the code for another extremely simple web app, but this one introduces a new concept: animation. If you’ve ever done any web development in JavaScript, you’ll notice that the process in Dart is pretty similar. That’s because Dart compiles down to JavaScript (with dart2js), so its API must be built on top of JavaScript’s. However, Dart does a good job of insulating programmers from most of JavaScript’s awkwardness. As you’ll see in this example, even the code for a one-off web example can be elegant in Dart.

    Read on →