Skip to content

Commit

Permalink
when idle look at cat
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 28, 2011
1 parent 05d651b commit 9a41ed5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions public/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,19 @@ o(function(){
rightEye.css('left', min(rebw, max(0, x - rebx)));
}

// when idle look at the chaton
setInterval(function(){
var off = o('#cat').offset();
lookat(off.left, off.top);
}, 200);

if (!prev) {
var off = o('#cat').offset();
lookat(off.left, off.top);
}
prev = null;
}, 500);

// look at cursor
var prev;
o(document).mousemove(function(e){
// lookat(e.clientX, e.clientY);
prev = e;
lookat(e.clientX, e.clientY);
});
});

0 comments on commit 9a41ed5

Please sign in to comment.