Making of LLemMings

Lemming sprite

Collision detection and other small bits.

variable oldImgData is all pixel data gotten with ctx.getImageData()
function pixelIsColor(imageData, x, y, color) is used to get compare a color of a pixel
function getPixelColor(imageData, x, y) is used to get the color of a pixel

The colors of various pixel data are:
const waterColor = '#0077be';
const rockColor = '#888888';
const dirtColor = '#4a2e00';

Using the above:
Do collision detection for a sprite that looks a little like a blue lemming with green hair. It
should move around on a 2d canvas which has gravity (that is, when there is no ground under it,
it should fall down). If it runs in to an obstacle on the x or y axis it should turn around and
go the other way.