第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

大魚(yú)沒(méi)有跟上鼠標(biāo)動(dòng)

鼠標(biāo)一進(jìn)入界面 大魚(yú)就想左上角移動(dòng),固定在左上角了 ?求大神指教下

代碼如下:

// JavaScript Document

var momObj = function(){ //繪制大魚(yú)

this.x;

this.y;

this.angle;

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.angle = 0;

this.bigEye.src="./src/bigEye0.png";

this.bigBody.src="./src/bigSwim0.png";

this.bigTail.src="./src/bigTail0.png"; ??

}

momObj.prototype.draw = function()

{

//lerp x,y

this.x = lerpDistance(mx, this.x, 0.99);

this.y = lerpDistance(my, this.y, 0.99);

//delta angle

//Math.atan2(y,x)

var deltaY = my - this.y;

var deltaX = mx - this.x;

var beta = Math.atan2(deltaY,deltaX);//-PI, PI

//lerp angle

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

ctx1.save();

ctx1.translate(this.x,this.y);

ctx1.rotate(this.angle);

ctx1.drawImage(this.bigTail, -this.bigTail.width * 0.5+30 , -this.bigTail.height * 0.5);

ctx1.drawImage(this.bigBody, -this.bigBody.width * 0.5, -this.bigBody.height * 0.5);

ctx1.drawImage(this.bigEye, -this.bigEye.width * 0.5, -this.bigEye.height * 0.5);

ctx1.restore();

}


正在回答

2 回答

commonFunction.js在html中引進(jìn)來(lái)了沒(méi)有?

0 回復(fù) 有任何疑惑可以回復(fù)我~

謝謝 已經(jīng)好了

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕粉3451677

怎么解決的?
2016-10-22 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

大魚(yú)沒(méi)有跟上鼠標(biāo)動(dòng)

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)