sophia93014252989
2017-04-01 14:54
看了两遍视频了 代码也没错误 大鱼就是显示不出来是怎么了?
var momObj=function()
{
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="./src/bigEye0.png";
this.bigBody.src="./src/bigSwim0.png";
this.bigTail.src="./src/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,-this.bigTail.height*0.5);
ctx1.restore();
}
已解决 在HTML文件中将z-index:1;写成了z-index:1px
有没有大神说下1和1px的区别呢?
HTML5小游戏---爱心鱼(上)
92348 学习 · 551 问题
相似问题