为什么果实出不来了 求答案谢谢

来源:2-4 果实绘制(静态果实)

慕粉无情

2017-03-14 14:12

var fruitObj=function()

{

this.alive=[];

this.x=[];

this.y=[];

this.orange=new Image();

this.blue=new Image();

}

fruitObj.prototype.unm=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.orange.src="./src/fruit.png";

this.blue.src="./src/blue.png";

}

fruitObj.prototype.draw=function()

{

for(var i=0; i<this.num; i++)

{

ctx2.drawImage(this.orange,this.x[i], this.y[i]);

}

}

fruitObj.prototype.born=function()

{

var aneId=Math.floor(Math.random()*ane.num);

this.x[i] =ane.x[aneId];

this.y[i] =canHeight-ane.len[aneId];

}


写回答 关注

3回答

  • qq__9044
    2017-06-14 19:53:06
    已采纳

    您是怎样解决的,求答


    慕粉无情

    我给忘了 不好意思 太久的了

    2017-07-29 14:37:53

    共 1 条回复 >

  • 慕粉无情
    2017-07-29 14:39:14

    好好  检查一下就知道问题了   有时候可能是一个单词 或者一个空格都是可能的 

  • 慕粉无情
    2017-03-14 14:17:41

    出来了 

    liubao... 回复liubao...

    已经解决,全是粗心大意

    2017-06-06 15:54:12

    共 2 条回复 >

HTML5小游戏---爱心鱼(上)

学做HTML5游戏,轻轻松松带你上手,适合刚入手游戏开发的同学

92353 学习 · 550 问题

查看课程

相似问题