Flatland Simulator in JavaScript for HTML5 Canvas