(function() {
var Animal, Game;
var __bind = function(fn, me){ return function(){ return (me, arguments); }; };
Game = (function() {
function Game() {
= __bind(, this);;
= __bind(, this);; = 1;
= 60;
= / 2;
();
}
= function() {
var num;
= 0;
= new Date;
= 30;
= [];
for (num = 4; num >= 1; num--) {
();
}
return = setInterval(, 1000 / 30);
};
= function() {
clearInterval();
return = "In" + (()) + "You shot a total of 2 seconds" + + "a! (Press the ESC key to restart)";
};
= function() {
return (((new Date).getTime() - ()) / 1000);
};
= function() {
var animal;
animal = new Animal((() * ));
return (animal);
};
= function(deadAnimal) {
var animal;
return = (function() {
var _i, _len, _ref, _results;
_ref = ;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
animal = _ref[_i];
if (animal !== deadAnimal) {
_results.push(animal);
}
}
return _results;
}).call(this);
};
= function(position) {
var animal, matches;
matches = (function() {
var _i, _len, _ref, _results;
_ref = ;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
animal = _ref[_i];
if (() === position) {
_results.push(animal);
}
}
return _results;
}).call(this);
return matches[0];
};
= function() {
var animal, position, timeLeft, url, _i, _len, _ref;
url = [];
_ref = ;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
animal = _ref[_i];
();
}
while ( < ) {
position = ;
if (position === ) {
if (()) {
("@");
} else {
("O");
}
} else if ((position)) {
("a");
} else {
("-");
}
}
timeLeft = - ();
if (timeLeft <= 0) {
return ();
} else {
if (timeLeft < 10) {
timeLeft = "0" + timeLeft;
}
= (" " + timeLeft + "|") + ("") + ("|" + timeLeft);
return = "Points " + ;
}
};
= function(event) {
var animal;
switch () {
case 37:
-= 1;
if ( < 0) {
return = - 1;
}
break;
case 39:
+= 1;
return %= ;
case 38:
case 32:
animal = ();
if (animal) {
+= 1;
(animal);
();
if ( === 0) {
return ();
}
}
break;
case 27:
return ();
}
};
return Game;
})();
Animal = (function() {
function Animal(position) {
= position;
= () * 0.5;
= () * ;
= 0.4;
}
= function(levelSize) {
+= () * ;
+= () * ;
%= levelSize;
if ( < 0) {
return += levelSize;
}
};
return Animal;
})();
$(function() {
var game;
game = new Game();
return $(document).keydown();
});
}).call(this);