內容是一個連線泡泡球遊戲,請求高手幫我解釋程式的用意,不需每行解釋,只要解釋每一段的程式是在做什麼的即可,盡量白話一點,因字數有限,請加我MSN:miyz3158@hotmail.com,或留下EMAIL,感謝!!
完整檔案載點
http://www.sinocell.com.tw/event/2013/bubble.rar
var canvas;
var ctx;
var mp = {x:-1, y:-1, c:0};
var isStart = false;
var isSel = false;
var isRan = false;
var isEnd = false;
var isActive = false;
var ranArr = new Array();
var moveArr = new Array();
var score=0;
var beginTime;
var endTime;
var circle = Math.PI * 2;
var chessColor = new Array(7);
chessColor[0] = "";
chessColor[1] = "rgb(255, 82, 155)";
chessColor[2] = "rgb(255, 180, 82)";
chessColor[3] = "rgb(82, 255, 167)";
chessColor[4] = "rgb(82, 135, 255)";
chessColor[5] = "rgb(147, 82, 255)";
chessColor[6] = "rgb(255, 34, 34)";
chessColor[7] = "rgb(146, 146, 146)";
var map = new Array(9);
for(var i=0;i<9;i++) map[i] = new Array(9);
function game() {
canvas = document.getElementById("canvas");
if (canvas.getContext) ctx = canvas.getContext("2d");
var lineargradient = ctx.createLinearGradient(0,0,0,450);
lineargradient.addColorStop(0,'#E6E6E6');
lineargradient.addColorStop(1,'#FFF');
ctx.fillStyle = lineargradient;
ctx.fillRect(0,0,450,450);
ctx.strokeStyle = "#CCCCCC";
ctx.strokeRect(0.5,0.5,450,500);
drawChess(232.5,207,Math.floor(Math.random()*7)+1,1);
ctx.font = "20pt Arial";
ctx.fillStyle = "#969696";
ctx.fillText("點這裡開始", 165, 280);
document.getElementById("commentbox").style.left=canvas.offsetLeft+110+"px";
document.getElementById("commentbox").style.top=canvas.offsetTop+125+"px";
document.getElementById("scorebox").style.left=canvas.offsetLeft+12+"px";
document.getElementById("scorebox").style.top=canvas.offsetTop+473+"px";
document.getElementById("restartbox").style.left=canvas.offsetLeft+374+"px";
document.getElementById("restartbox").style.top=canvas.offsetTop+471+"px";
}
.
.
.
.
miyz3158提到:
作業需要
miyz3158提到:
不應該發問是嗎...?
miyz3158提到:
網頁遊戲設計
temo提到:
成大期末考打飛機
miyz3158提到:
所以,我不應該發問是嗎...?
et54987提到:
應該是屬於不值得討論
et54987提到:
我的問題都沒啥回應
ycl8000提到:
只能去夜市擺攤
cdfu提到:
賣雞排
looney提到:
膿
cdfu提到:
由我親自處理了
不錯不錯,跟我一樣,程式就是最好的注解
最上面就畫布,環境,權域變數宣告
顏色陣列
在畫布上圖鴉
....
位移控制項
程式碼很好了,用英文解釋,你可能看不懂.用中文翻譯,可能Code還糟糕.
如果給教授看,他應該要看得懂,如果你翻譯錯的,那~