Skip to content

Instantly share code, notes, and snippets.

var landscape = new Landscape(); // one actor
// make instance of Machine and get the root nodes for each actor
var machine = new Machine();
landscape.state = machine.generateTree(landscapeJson, landscape);
// every second, something happens in the ecosystem
setTimeout("step()", 1000);
var step = function() {
// trigger the next state transition