Files
sis/js/spaceinvaders-utils.js
Fabrice Ecaille dbef43e61b Feature: add 2 kinds of aliens
Refactoring: better way to manage aliens
Refatcoring: creating models and animations folders to manage independent files
2013-11-28 17:52:19 +01:00

13 lines
293 B
JavaScript

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;
}