課程
/前端開發(fā)
/HTML/CSS
/HTML5小游戲---愛心魚(上)
不知道哪里出問題了
2017-04-13
源自:HTML5小游戲---愛心魚(上) 2-5
正在回答
我也有這樣原問題,我是在畫背景的時候多添加了句代碼
function drawBackground() {
???? bgPic.onload = function() {
???? ???? ctx2.drawImage(bgPic, 0, 0, canWidth, canHeight);
???? }
}
改成:
???? ctx2.drawImage(bgPic, 0, 0, canWidth, canHeight);
沒代碼,很難找到問題,我猜你的果實是畫的嗎?,下載圖片資源用context2.drawImage(this.fruitType[i], this.x[i] - this.l[i] * 0.5, this.y[i] - this.l[i]*0.5, this.l[i], this.l[i]);
舉報
學(xué)做HTML5游戲,輕輕松松帶你上手,適合剛?cè)胧钟螒蜷_發(fā)的同學(xué)
1 回答為什么果實往上走了,但是還會有線條
4 回答為什么我的果實上浮時是一條直線
1 回答有沒有同學(xué)大魚碰到果實了 但是果實不消失!而且函數(shù)還執(zhí)行了
1 回答幫我看看怎么畫不出一條直線?
2 回答果實不顯示,怎么辦?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2018-06-03
我也有這樣原問題,我是在畫背景的時候多添加了句代碼
function drawBackground() {
???? bgPic.onload = function() {
???? ???? ctx2.drawImage(bgPic, 0, 0, canWidth, canHeight);
???? }
}
改成:
function drawBackground() {
???? ctx2.drawImage(bgPic, 0, 0, canWidth, canHeight);
}
2017-04-14
沒代碼,很難找到問題,我猜你的果實是畫的嗎?,下載圖片資源用context2.drawImage(this.fruitType[i], this.x[i] - this.l[i] * 0.5, this.y[i] - this.l[i]*0.5, this.l[i], this.l[i]);