mirror of
https://git.sleeping.town/mirrors/foxy-moxy
synced 2024-11-14 16:17:44 +00:00
Merge branch 'master' of github.com:Patreon/foxy-moxy
This commit is contained in:
commit
11f042ccc0
1 changed files with 21 additions and 10 deletions
31
js/fox.js
31
js/fox.js
|
@ -4,12 +4,9 @@ var IMG_WIDTH = 64;
|
|||
var IMG_HEIGHT = 64;
|
||||
|
||||
// move to helper function
|
||||
var Point = function (x, y) {
|
||||
return {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
};
|
||||
var genBetween = function (min, max) {
|
||||
return min + (max - min) * gen();
|
||||
}
|
||||
|
||||
var randomFox = (function () {
|
||||
|
||||
|
@ -20,18 +17,32 @@ var randomFox = (function () {
|
|||
var height = IMG_HEIGHT / 2;
|
||||
|
||||
var ears = (function () {
|
||||
// TODO: generate stuff
|
||||
var offsetX = genBetween(0, width/2);
|
||||
return {
|
||||
left: {
|
||||
x: null
|
||||
x: origin.x + (width/2) - offsetX,
|
||||
y: origin.y
|
||||
},
|
||||
right: {
|
||||
x: null
|
||||
x: origin.x + (width/2) + offsetX,
|
||||
y: origin.y
|
||||
}
|
||||
};
|
||||
});
|
||||
}());
|
||||
|
||||
var eyes = (function () {
|
||||
// TODO: generate stuff
|
||||
return {
|
||||
|
||||
};
|
||||
}());
|
||||
|
||||
return {
|
||||
shape: {
|
||||
origin: origin,
|
||||
width: width,
|
||||
height: height
|
||||
},
|
||||
ears: ears,
|
||||
eyes: eyes,
|
||||
nose: nose,
|
||||
|
|
Loading…
Reference in a new issue