Originally written by Anthony Pace (aka NME), in Toronto, Ontario, Canada. email@example.com
This is a JS version of the code I originally wrote in AS3 here. http://wonderfl.net/c/r2tR
This was pretty simple, but I was curious to see how this would run in JS, and I hadn't written any JS in a while.
I prefer AS3 to JS, because it's just a better variant of ECMA Script; yet, JS seems to handle this kind of thing (writing to Canvas) fairly well. Chrome executes JS a bit slowly I find, but it's still workable.
My only problem with JS is really just the little things:
E.G. 1: when dealing with bit shifting at 32bit or higher you have to use num>>>x or something similar, whereas, in a language that knows the number is unsigned, you can just write num>>x
E.G. 2: When writing to a buffer, you have to use r,g,b,a,r,g,b,a, etc.... instead of simple using a 24Bit hex value. At the very least, it would be nice to have both options. Also, why does the element have to have an alpha channel? Why not just RGB?
Anyways, as I said, it's the little things with JS that annoy me; yet, it is the little things that add up to make the whole.