Skip to content

Instantly share code, notes, and snippets.

// 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()