同跪在这里,怒复制以警示。
老师的重点&&逻辑真是一点也不清楚。。。不管怎样,老师您辛苦了
搞了半天,解决漂浮直线和海葵不透明,在gameloop里面用cxt2画背景图片才能盖住上一帧:
function gameloop(){
cxt2.drawImage(bg,0,0);
ane.draw();
fruit.draw();
}
老师的重点&&逻辑真是一点也不清楚。。。不管怎样,老师您辛苦了
搞了半天,解决漂浮直线和海葵不透明,在gameloop里面用cxt2画背景图片才能盖住上一帧:
function gameloop(){
cxt2.drawImage(bg,0,0);
ane.draw();
fruit.draw();
}
2016-10-21
已采纳回答 / 码农2012
ctx2.drawImage(this.pic,this.x[i]-this.l[i]*0.5,this.y[i]-this.l[i]*0.5,this.l[i],this.l[i]);去掉pic前面的.this
2016-10-21
果实没出来的同学改一下born函数里面的this.y[i]的值,将this.y[i]改大一点就能看见果实了;fruitObj.prototype.born = function(i){
var aneID = Math.floor(Math.random()*ane.num);
this.x[i] = ane.rootx[aneID];
this.y[i] = ane.heady[aneID];
console.log(ane.heady[aneID]);
}
var aneID = Math.floor(Math.random()*ane.num);
this.x[i] = ane.rootx[aneID];
this.y[i] = ane.heady[aneID];
console.log(ane.heady[aneID]);
}
2016-10-19
最新回答 / 慕粉1461495807
Draw.js:2 Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)'出现这个问题怎么解决?图片地址也写了啊: var bgpic=new Image();function ga...
2016-10-18