我的果实也没出来
var fruitObj = function(){
this.alive = [];
this.x=[];
this.y=[];
this.huang = new Image();
this.lan = new Image();
}
fruitObj.prototype.num = 30;
fruitObj.prototype.init = function(){
for(var i = 0; i < this.num; i++) {
this.alive[i]=true;
this.x[i] = 0;
this.y[i] = 0;
this.born(i);
}
this.huang.src="./src/fruit.png";
this.lan.src="./src/blue.png";
}
fruitObj.prototype.draw = function(){
for (var i = 0; i < this.num; i++) {
ctx2.drawImage(this.huang,this.x[i] - this.huang.width*0.5,this.y[i] - this.huang.height*0.5);
}
}
fruitObj.prototype.born = function(i){
var aneID =Math.floor( Math.random() * ane.num);
this.x = ane.x[aneID];
this.y = canHeight - ane.len[aneID];
}