課程
/前端開發
/HTML/CSS
/HTML5小游戲---愛心魚(上)
就是一個background.js ?和main.js,2個文件都放在js 文件夾里,為什么background 不能用main.js的ctx2
2017-04-12
源自:HTML5小游戲---愛心魚(上) 2-1
正在回答
1.html要引用
<script type="text/javascript" src="js/main.js" ></script>
<script type="text/javascript" src="js/background.js" ></script>
2.?document.body.onload = game; ?
舉報
學做HTML5游戲,輕輕松松帶你上手,適合剛入手游戲開發的同學
3 回答請問為什么ctx2每次刷新都不需要ctx2.clearRect(0,0,canWidth, canHeight);?
3 回答為什么把draw在ctx2大魚才看得見?
1 回答ctx2.moveTo(this.x[i],canHeight);怎么解釋?
12 回答老師,我什么我改成這樣ctx2.drawImage(this.orange,this.x[i] - this.l[i] * 0.5,this.y[i] - this.l[i] * 0.5,this.l[i],this.l[i]); 黃點就不出現了
1 回答大魚顯示不出來,將ctx1改成ctx2才顯示
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-04-14
1.html要引用
<script type="text/javascript" src="js/main.js" ></script>
<script type="text/javascript" src="js/background.js" ></script>
2.?document.body.onload = game; ?