Javascript / Canvas Terrain Generator

Your browser does not support the canvas element.

As a bit of a JavaScript programming project with my boys AKA "the clones", we decided to write a fractal landscape generator. Their first terrain generator was written in Scratch, but it was soooo slow, and I was keen to teach them a real programming language anyway, so we re-wrote it in JavaScript, using html5 <canvas>. The rendering is now so much faster, we can generate much more detailed landscapes, simulate a sunrise in the changing angle of the shadows, and add all sorts of extra colours. The code is surprisingly simple for such pretty results - feel free to "view source" and skip to the <script> at the end.