代码拉取完成,页面将自动刷新
var Main;
(function(){
var rect; //敌人;
var text; //文本
var star; //星星;
var score=10; //分
var hitNum=0; //击中的个数
Main = function(){
Main.prototype.init();
}
Main.prototype.init=function()
{
OBODY.style.background="url("+BG+") no-repeat center top";
OBODY.style.overflow="hidden";
OBODY.style.height=CLIENTHEIGHT+"px";
text = new Text();
text.init();
rect = new oTuZi();
rect.init();
star = new Star(50);
star.init();
//添加经过事件;
Main.prototype.addOverEvent();
//计时
Main.prototype.getTimeJs();
//页面发生改变;
Main.prototype.scrollSize();
//背景抖动;
Main.prototype.bgMove();
}
Main.prototype.bgMove=function()
{
var x,y;
setInterval(function(){
x=0.6*Math.random()+0.7
y=0.6*Math.random()+0.4
OBODY.style.backgroundPosition =x+"% "+y+"%";
},500)
}
Main.prototype.scrollSize=function()
{
CLIENTHEIGHT = document.body.clientHeight || document.documentElement.clientHeight; //页面高度;
CLIENTWIDTH = document.body.clientWidth || document.documentElement.clientWidth; //页面宽度
var divElements,i;
window.onresize=function(){;
divElements = document.getElementsByTagName("div");
for(i=0;i<CLEARBARR.length;i++)
{
//clearTimeout(CLEARBARR[i])
}
}
}
Main.prototype.getTimeJs=function()
{
var jsDate=0.01;
var hours='';
var hoursIndex=0;
JSOBJ = document.getElementById(JS);
setInterval(function(){
jsDate+=0.01;
JSOBJ.value=hours+jsDate.toFixed(2)+"秒";
},9)
}
Main.prototype.addOverEvent=function()
{
HITOBJ = document.getElementById(JZ);
SCOREOBJ = document.getElementById(DF);
document.addEventListener("click",onOver,false);
function onOver()
{
if(event.target.parentNode.getAttribute("numIndex"))
{
hitNum++
HITOBJ.value=""+hitNum;
SCOREOBJ.value =""+ hitNum*score
oTuZi.prototype.clearEventElement(event.target.parentNode);
}
}
}
})();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。