This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// declare bullet pools | |
var activeBullets = []; | |
var bulletPool = []; | |
// construct some bullets ready for use | |
for (var i=0; i < 20; i++) | |
bulletPool.push( new Bullet() ); | |
// a constructor/factory function | |
function getNewBullet() |