« first day (2107 days earlier)      last day (2010 days later) » 

 
2 hours later…
 
1 hour later…
 
2 hours later…
 
3 hours later…
 
4 hours later…
 
1 hour later…
19:44
Well, you probably saw the code in my jsfiddle, right. Some person said I should instead use Object.assign, like so:

const explosions = Object.assign([], {
pool : [],
create() {
var exp;
if (explosions.pool.length) {
exp = explosions.pool.pop();
} else {
exp = new Explosion();
}
explosions.push(exp);
return exp;
},
update() {
var i;

for (i = 0; i < explosions.length; i ++) {
if (explosions[i].update() === false) {
explosions.pool.push(explosions.splice(i--, 1)[0]);
}
}
},
});
1 message moved from JavaScript

« first day (2107 days earlier)      last day (2010 days later) »