登 录
var pubCellNumber var pubOrbits_X = new Array(256 * 16); var pubOrbits_Y = new Array(256 * 16); var pubOffList = new Array(256); var pubLimit_X = []; var pubLimit_Y = []; var pubSpanObjects = new Array(32 * 16); var pubColors = new Array(256 * 16) var pubStepOn = 0; var pubWorkOn = 0; var pubX = 0; var pubY = 0; var pubScale = 0; var pubTime = 0; var pubCellLength = 0; var pubLightLength = 0; var pubSpeed = 0; var pubGLimit = 0;
window.onload = function () { pubCellLength = 24; pubLightLength = 15;
CreateObjects(pubCellLength, pubLightLength); CreateColors(); CreateLimits(); NewSkyrocket(); ShowSkyrocket(); } function NewSkyrocket() { pubX = Math.floor(Math.random() * 640); pubY = Math.floor(Math.random() * 480); pubScale = Math.random() * 1 + 1; pubStepOn = 10; for (var tIndex = 0; tIndex <= pubCellLength; tIndex++) { pubOffList[tIndex] = Math.floor(Math.random() * 20) + 44; } CellsClear(); CreateColors(); CreateLimits(); pubTime = setTimeout("ShowSkyrocket();", 10); }
function ShowSkyrocket() { if (pubWorkOn < 64) { pubWorkOn++; if (pubSpeed > 3) pubSpeed = pubSpeed - 2; ViewObjects(pubCellLength, pubLightLength, pubScale, pubX, pubY); CellsMove(pubOrbits_X, pubOrbits_Y, pubLimit_X, pubLimit_Y, pubCellLength, pubLightLength, pubSpeed); pubTime = setTimeout("ShowSkyrocket();", 1); } else { pubWorkOn = 0; pubSpeed = 24; NewSkyrocket(); } }
function ViewObjects(pCellLength, pLightLength, pScale, pX, pY) { for (var tIndex = 0; tIndex <= pCellLength; tIndex++) { for (var tLight = 0; tLight <= pLightLength; tLight++) { with (pubSpanObjects[tIndex * 256 + tLight].style) { if (pubWorkOn > pubOffList[tIndex] + (pLightLength - tLight)) { color = rgb(0, 0, 0); } else { color = pubColors[tIndex * 256 + 15]; tRndBase = (pLightLength - tLight) * pubScale; top = pubOrbits_Y[tIndex * 256 + tLight] * pubScale + pY + Math.floor(Math.random() * tRndBase) - tRndBase / 2; tRndBase = (pLightLength - tLight) * pubScale; left = pubOrbits_X[tIndex * 256 + tLight] * pubScale + pX + Math.floor(Math.random() * tRndBase) - tRndBase / 2; } } } } }
function CreateObjects(pCellLength, pLightLength) { for (var tIndex = 0; tIndex <= pCellLength; tIndex++) { for (var tLight = 0; tLight <= pLightLength; tLight++) { pubSpanObjects[tIndex * 256 + tLight] = document.createElement("SPAN"); with (pubSpanObjects[tIndex * 256 + tLight]) { innerHTML = "."; } with (pubSpanObjects[tIndex * 256 + tLight].style) { position = "absolute" color = rgb(0, 0, 0) } idInsertObject.appendChild(pubSpanObjects[tIndex * 256 + tLight]); } } }
function CreateColors() { var tColor = new Array(3); tColor[0] = Math.random() * 0.5 + 0.5 ; tColor[1] = Math.random() * 0.5 + 0.5 ; tColor[2] = Math.random() * 0.5 + 0.5 ; tColor[Math.floor(Math.random() * 3)] = 1; for (var tColorIndex = 0; tColorIndex 点燃 [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
抱歉!评论已关闭.