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

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

為什么??€是繪制不出來(lái)

//創(chuàng)建一個(gè)??念?lèi)

var aneObj = function(){

this.x =[];//???lèi)型定義為一個(gè)數(shù)組

this.len =[];//??母叨?/p>

}

aneObj.prototype.num = 50;//??麛?shù)量


//初始化???/p>

aneObj.prototype.init = function(){

for(var i =0;i<this.num;i++){

this.x[i] = i * 10 + Math.random()*20;//隨機(jī)生成??奈恢?/p>

this.len[i] = 200 + Math.random()*50;//隨機(jī)生成??母叨?/p>

}

}

//繪制海葵

aneObj.prototype.draw = function(){

for(var i =0;i<this.num;i++){

ctx2.beginPath();//使用beginPath繪制路徑

ctx2.moveTo(this.x[i],canHeight);//繪制起始位置

ctx2.lineTo(this.x[i],canHeight - this.len[i]);//繪制結(jié)束位置

ctx2.lineWidth=10;

ctx2.lineCap="round";

ctx2.strokeStyle = "purple";//??麡邮?,顏色

ctx2.stroke();//先確定樣式后執(zhí)行stroke方法,刷出???/p>


}

}


正在回答

1 回答

draw方法放到gameloop函數(shù)中了嗎?

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

舉報(bào)

0/150
提交
取消
HTML5小游戲---愛(ài)心魚(yú)(上)
  • 參與學(xué)習(xí)       92343    人
  • 解答問(wèn)題       583    個(gè)

學(xué)做HTML5游戲,輕輕松松帶你上手,適合剛?cè)胧钟螒蜷_(kāi)發(fā)的同學(xué)

進(jìn)入課程

為什么??€是繪制不出來(lái)

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

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

幫助反饋 APP下載

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

公眾號(hào)

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