Canvas Cold War

Growing up in the ’80s wasn’t as cool as it’s made out to be. As a teenager of that decade, we not only lacked any reasonable fashion sense, we lived under the constant shadow of nuclear oblivion. In hindsight, the arms race begat some huge advances in computing theory and practice, and since your average mobile phone is more powerful than that era’s entire North American early warning system, makes a great target for simulation.

Cold War is an in-browser recreation of the nightmare that was the ’80s, exploring emergent systems, the limits of Javascript performance, and some techniques that might actually be useful in your day job when you get back to civilization. Expect vector graphics, high altitude bombers, missiles, killer satellites and explosions. More than a few explosions. And unlike the ’80s, lasers that actually work.

16ms to jank! That’s our budget.

Canvas transform/translate commands are the key to really understand how to get canvas to do cool stuff. They let you do transforms with a minimum of mathematical calculations.

Classic example is the swarm simulation: you don’t define the behaviour, you define the conditions that the actors will respond to and what they will do. Then you see emergent behaviour.

This is how you can build up the Cold War game, where the nation states have a variety of weapons and counter-weapons. You can then run your simulation without actually knowing the result.

(look up the video for this one!)

simonswain.com/coldwar