??怀鰜碓趺崔k
330fish.js:52 Uncaught TypeError: Cannot read property 'draw' of undefined?
aneobj.prototype.draw?=?function(){ ????for(var?i=0;i<this.num;i++){ ????????ctx2.beginPath(); ????????ctx2.moveTo(this.x[i],cHeight); ????????ctx2.lineTo(this.x[i],cHeight?-?this.len[i]); ????????ctx2.lineWidth?=?20; ????????ctx2.linCap?=?"round"; ????????ctx2.strokeStyle?="purple"; ????????ctx2.stroke(); ????}
function?gameloop(){ ????requestAnimFrame(gameloop); ????var?now?=?Date.now(); ????deltaTime?=?now?-?lastTime;? ????lastTime?=?now;? ????drawBackground(); ????ane.draw(); }
2016-07-03
1 檢查下你有沒有把這個(gè)js引進(jìn)HTML中
2 檢查下在主函數(shù)的init()中是否創(chuàng)建了?ane=new aneObj();