課程
/前端開發
/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]);
舉報
學做HTML5游戲,輕輕松松帶你上手,適合剛入手游戲開發的同學
1 回答為什么果實往上走了,但是還會有線條
4 回答為什么我的果實上浮時是一條直線
1 回答有沒有同學大魚碰到果實了 但是果實不消失!而且函數還執行了
1 回答幫我看看怎么畫不出一條直線?
2 回答果實不顯示,怎么辦?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
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]);