时研冰
2020-01-18 05:12
源码是这样的:
var babyBodyCount = this.babyBodyCount;
ctx1.drawImage(babyBoby[babyBodyCount], -babyBoby[babyBodyCount].width * 0.5+23, -babyBoby[babyBodyCount].height * 0.5);
报错如下:
baby.js:104 Uncaught TypeError: Cannot read property 'width' of undefined
at babyObj.draw (baby.js:104)
at gameloop (main.js:111)
at game (main.js:37)
是不是main.js文件里用来存放图片的数组babyBody没有定义,或者定义错了?
HTML5小游戏---爱心鱼(下)
46272 学习 · 189 问题
相似问题