我有一个像下面这样的对象
function obj() {
this.cellSize = 50;
this.createBlock = function() { // creates a block object
this.x = 0;
this.y = 0 - (this.cellSize * 1.5);
this.baseVelocity = 1;
this.velocity = this.baseVelocity;
return this;
};
this.activeBlock = this.createBlock(); // active block object
this.nextBlock = this.createBlock(); // next block object
}
当我检查obj.activeBlock
我没有得到应该返回的对象时obj.createBlock
?
谢谢,