var?momObj?=?function()?//大魚(yú)
{
this.x;
this.y;
this.bigEye?=?new?Image();
this.bigBody?=?new?Image();
this.bigTail?=?new?Image();
}
momObj.prototype.init?=?function()
{
this.x?=?canWidth?*?0.5;
this.y?=?canHeight?*?0.5;
this.bigEye.src?=?"img/bigEye0.png";
this.bigBody.src?=?"img/bigSwim0.png";
this.bigTail.src?=?"img/bigTail0.png";
}
momObj.prototype.draw?=?function()
{
ctx1.save();
ctx1.translate(this.x,this.y);
ctx1.drawImage(this.bigEye,?-this.bigEye.width*0.5,?-this.bigEye.height*0.5);
ctx1.drawImage(this.bigBody,?-this.bigBody.width*0.5,?-this.bigBody.height*0.5);
ctx1.drawImage(this.bigTail,?-this.bigTail.width*0.5?+?30,?-this.bigTail.height*0.5);?
ctx1.restore();
}
2019-01-09
mian里的執(zhí)行順序的問(wèn)題正確的是
2018-12-26
我粘貼復(fù)制了,這串代碼沒(méi)有問(wèn)題。你看看<script type="text/javascript" src="js/mom.js"></script>寫(xiě)沒(méi)有,或者mom.draw();