为什么我的大鱼不论吃什么颜色的果实都是现实蓝色的身体?
for(var i = 0; i < 8; i++)
{
mamaBodyOra[i] = new Image();
mamaBodyBlue[i] = new Image();
mamaBodyOra[i].src = "./src/bigSwim" + i + ".png";
mamaBodyBlue[i].src = "./src/bigSwimBlue" + i + ".png";
}
var mamaBodyCount = this.mamaBodyCount;
if(data.double == 1)//吃的是orage
{
ctx1.drawImage(mamaBodyOra[mamaBodyCount], -mamaBodyOra[mamaBodyCount].width * 0.5, -mamaBodyOra[mamaBodyCount].height * 0.5);
}
else//吃的蓝色果实
{
ctx1.drawImage(mamaBodyBlue[mamaBodyCount], -mamaBodyOra[mamaBodyCount].width * 0.5, -mamaBodyOra[mamaBodyCount].height * 0.5);
}
其他和小鱼碰撞恢复初始状态都没有错。就是吃果实身体一直都是蓝色状态。