diff --git a/js/spaceinvaders-utils.js b/js/spaceinvaders-utils.js deleted file mode 100644 index 8ef3202..0000000 --- a/js/spaceinvaders-utils.js +++ /dev/null @@ -1,12 +0,0 @@ -function getAliensMidHeight() { - var higherAlien = Math.max.apply( null, - $(".alien").map(function() { - return $(this).y(); - }).get() ), - lowerAlien = Math.min.apply( null, - $(".alien").map(function() { - return $(this).y(); - }).get() ); - - return (higherAlien + lowerAlien) / 2; -} diff --git a/js/tools.js b/js/tools.js index 1776d24..68e8763 100644 --- a/js/tools.js +++ b/js/tools.js @@ -67,3 +67,17 @@ function angle(vector1, vector2) { return sign * alpha; } + + +function getAliensMidHeight() { + var higherAlien = Math.max.apply( null, + $(".alien").map(function() { + return $(this).y(); + }).get() ), + lowerAlien = Math.min.apply( null, + $(".alien").map(function() { + return $(this).y(); + }).get() ); + + return (higherAlien + lowerAlien) / 2; +} \ No newline at end of file