A JS port of tanktrouble.com