亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

身體完全變白過后就報錯了,大于亂跳,小魚不見了

var?babyObj?=?function()?{
	this.x;
	this.y;
	this.angle;

	this.babyTailTimer?=?0;
	this.babyTailCount?=?0;

	this.babyEyeTimer?=?0;
	this.babyEyeCount?=?0;
	this.babyEyeInterval?=?1000;

	this.babyBodyTimer?=?0;
	this.babyBodyCount?=?0;

}
babyObj.prototype.init?=?function()?{
	this.x?=?canWidth?*?0.5?-?50;
	this.y?=?canHeight?*?0.5?+?50;
	this.angle?=?0;

}
babyObj.prototype.draw?=?function()?{

	this.x?=?lerpDistance(mom.x,?this.x,?0.98);
	this.y?=?lerpDistance(mom.y,?this.y,?0.98);

	var?deltaY?=?mom.y?-?this.y;
	var?deltaX?=?mom.x?-?this.x;
	var?beta?=?Math.atan2(deltaY,?deltaX)?+?Math.PI;

	this.angle?=?lerpAngle(beta,?this.angle,?0.6);

	this.babyTailTimer?+=?deltaTime;
	if(this.babyTailTimer?>?50)?{
		this.babyTailCount?=?(this.babyTailCount?+?1)?%?8;
		this.babyTailTimer?%=?50;
	}

	this.babyEyeTimer?+=?deltaTime;
	if(this.babyEyeTimer?>?this.babyEyeInterval)?{
		this.babyEyeCount?=?(this.babyEyeCount?+?1)?%?2;
		this.babyEyeTimer?%=?this.babyEyeInterval;

		if(this.babyEyeCount?==?0)?{
			this.babyEyeInterval?=?Math.random()?*?1500?+?2000;
		}?else?{
			this.babyEyeInterval?=?200;
		}
	}

	this.babyBodyTimer?+=?deltaTime;
	if(this.babyBodyTimer?>?300)?{
		this.babyBodyCount?=?this.babyBodyCount?+?1;
		this.babyBodyTimer?=?0;//就是加上這一行就報錯了Uncaught?TypeError:?Cannot?read?property?'width'?of?undefined(…)
		if(this.babyBodyTimer?>?19)?{
			this.babyBodyCount?=?19;
		}
	}

	ctx1.save();
	ctx1.translate(this.x,?this.y);
	ctx1.rotate(this.angle);

	var?babyTailCount?=?this.babyTailCount;
	ctx1.drawImage(babyTail[babyTailCount],?-babyTail[babyTailCount].width?*?0.5?+?23,?-babyTail[babyTailCount].height?*?0.5);

	var?babyBodyCount?=?this.babyBodyCount;
	ctx1.drawImage(babyBody[babyBodyCount],?-babyBody[babyBodyCount].width?*?0.5,?-babyBody[babyBodyCount].height?*?0.5);

	var?babyEyeCount?=?this.babyEyeCount;
	ctx1.drawImage(babyEye[babyEyeCount],?-babyEye[babyEyeCount].width?*?0.5,?-babyEye[babyEyeCount].height?*?0.5);

	ctx1.restore();

}


正在回答

1 回答

if(this.babyBodyTimer?>?19)?{

????????????this.babyBodyCount?=?19;

????????}

檢查一下

0 回復 有任何疑惑可以回復我~
#1

qq_我在呢_0 提問者

非常感謝!
2017-03-27 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

身體完全變白過后就報錯了,大于亂跳,小魚不見了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號