如何重置对象的变量?

时间:2018-06-09 13:24:33

标签: javascript javascript-objects

我正在尝试重置

中的以下对象
draw = function() {...}

var Beaver = function(x, y) {    
    this.x = x;   
    this.y = y;   
    this.img = getImage("");   
    this.sticks = 0;   
    this.holes = 0;   
    this.npcs = 0;   
};
var Stick = function(x, y) {    
    this.x = x;    
    this.y = y;    
};
var Hole = function(x, y) {   
    this.x = x;   
    this.y = y;   
};
var Npc = function(x, y) {    
    this.x = x;    
    this.y = y;    
    this.img = getImage("");    
};

怎么做?

0 个答案:

没有答案