mirror of
https://github.com/Febbweiss/sis.git
synced 2026-03-04 22:25:35 +00:00
Feature: add 2 kinds of aliens
Refactoring: better way to manage aliens Refatcoring: creating models and animations folders to manage independent files
This commit is contained in:
12
js/spaceinvaders-utils.js
Normal file
12
js/spaceinvaders-utils.js
Normal file
@@ -0,0 +1,12 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user