Soon I’ll tame those pesky eyeballs

Changed the eye placement algorithm a little bit just to get a wider range of y values. Working on something to make sure they’re always within the body (sometimes you’ll find that they show up out in space).

Also added some coherence to the coloring. It generates a random number between 0×000000 and 0xFFFFFF to pick the base color, and then extracts the rgb using fancy little bitwise math, reduces each component by half, and recombines it all into that nice, dark shade.

bodyColors = Math.random() * 0xFFFFFF;
var r = bodyColors >> 16;
var g = bodyColors >> 8 & 0xFF;
var b = bodyColors & 0xFF;
featureColors = (r/2 << 16) | (g/2 << 8) | b/2;

Post a Comment

Your email is never shared. Required fields are marked *