remove utility Point class and add ear pos gen

This commit is contained in:
Jeffrey Sun 2016-12-15 12:21:43 -08:00
parent fc79fddac4
commit 71d578d5a6

View file

@ -4,12 +4,9 @@ var IMG_WIDTH = 64;
var IMG_HEIGHT = 64; var IMG_HEIGHT = 64;
// move to helper function // move to helper function
var Point = function (x, y) { var genBetween = function (min, max) {
return { return min + (max - min) * gen();
x: x, }
y: y
};
};
var randomFox = (function () { var randomFox = (function () {
@ -20,18 +17,32 @@ var randomFox = (function () {
var height = IMG_HEIGHT / 2; var height = IMG_HEIGHT / 2;
var ears = (function () { var ears = (function () {
// TODO: generate stuff var offsetX = genBetween(0, width/2);
return { return {
left: { left: {
x: null x: origin.x + (width/2) - offsetX,
y: origin.y
}, },
right: { right: {
x: null x: origin.x + (width/2) + offsetX,
y: origin.y
} }
}; };
}); }());
var eyes = (function () {
// TODO: generate stuff
return {
};
}());
return { return {
shape: {
origin: origin,
width: width,
height: height
},
ears: ears, ears: ears,
eyes: eyes, eyes: eyes,
nose: nose, nose: nose,