return的作用???
haloObj.prototype.born = function (x, y) {
for (var i = 0; i < this.num; i++) {
if (!this.alive[i]) {
//console.log("born");
this.alive[i] = true;
this.r[i] = 10;
this.x[i] = x;
this.y[i] = y;
return;
}
}
}
haloObj.prototype.born = function (x, y) {
for (var i = 0; i < this.num; i++) {
if (!this.alive[i]) {
//console.log("born");
this.alive[i] = true;
this.r[i] = 10;
this.x[i] = x;
this.y[i] = y;
return;
}
}
}
2017-04-06
举报