




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
一款基础模型的JS打飞机游戏特效代码一款基础模型的JS打飞机游戏特效代码郑州悦美整形美容医院 郑州展览公司 #show margin:auto; width:300px; height:500px; background: black; position: relative;#fly width:10px; height:10px; position:absolute; bottom:0; left:140px; background: #0044ff;#sco z-index:1; color:white;.arrow width:6px; height:6px; background: #ddd; margin-left: 2px; margin-top:-10px;.huiji width:10px; height:10px; background: #eee; position:absolute; top:0; left:0; function $(id)/获得id return document.getElementById(id);function keydown(e) /判断键盘事件 var currKey=0,e=e|event; currKey=e.keyCode|e.which|e.charCode; return currKey;function getClass(obj,attr)/getElementsByClass var aArray=; var i=0; var aAll = obj.getElementsByTagName(*); for(i=0;i0&parseInt(that.leftSet()(parseInt(that.showWidth)-10) if(keydown()=37) that.leftSet(parseInt(that.flying.style.left)-5+px); else if(keydown()=39) that.leftSet(parseInt(that.flying.style.left)+5+px); else if(parseInt(that.leftSet()=0) if(keydown()=39) that.leftSet(parseInt(that.flying.style.left)+5+px); else if(parseInt(that.leftSet()=(parseInt(that.showWidth)-10) if(keydown()=37) that.leftSet(parseInt(that.flying.style.left)-5+px); ); setInterval(function()/子弹 for(var i=0;ithat.arrow.length;i+) if(Math.abs(parseInt(that.arrowi.style.marginTop)parseInt(that.showHeight)-10) that.arrowi.style.marginTop=parseInt(that.arrowi.style.marginTop)-10+px; else if(Math.abs(parseInt(that.arrowi.style.marginTop)=parseInt(that.showHeight)-10) that.arrowi.style.marginTop=-20px; ,that.arrowSpeed); , huijiInit:function() var that=this, left=Math.random()*290, textnode=document.createElement(div); that.showArea.appendChild(textnode).setAttribute(class,huiji); textnode.style.left=0; textnode.style.top=0; textnode.style.left=left+px; setInterval(function() if(Math.abs(parseInt(textnode.style.top)parseInt(that.showHeight)+10) textnode.style.top=parseInt(textnode.style.top)+1+px; for(var i=0;ithat.arrow.length;i+) if(Math.abs(parseInt(that.arrowi.style.marginTop)=Math.abs(parseInt(textnode.style.top)-20&parseInt(that.leftSet()left&parseInt(that.leftSet()left+20) textnode.remove(); that.scores+=1; else if(Math.abs(parseInt(textnode.style.top)=parseInt(that.showHeight)+10) textnode.remove(); ,that.huijiSpeed); , score:function() var textnode=document.createElement(div); if(!document.getElementById(sco) this.showArea.insertBefore(textnode).setAttribute(id,sco).innerHTML=this.scores; else document.getElementById(sco).innerHTML=this.scores; , init:function()
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 大数据驱动的项目决策支持系统-洞察阐释
- 会展活动对城市文化空间的塑造-第1篇-洞察阐释
- 氟污染源识别技术-洞察阐释
- 智能教育装备推广效果评估-洞察阐释
- 旧货供应链的创新与模式创新研究-洞察阐释
- 机器学习在软件预测性维护中的应用-洞察阐释
- 基于大数据的跨境电商市场预测模型-洞察阐释
- 腈纶纤维的生命周期评估与环境影响考核试卷
- 网络安全协议仿真与优化考核试卷
- 体育运动知识与技能考核试卷
- 浙江省现代化水厂评价标准
- MOOC 音乐导聆-山东大学 中国大学慕课答案
- 保安定期开展心理健康培训
- 农行超级柜台业务知识考试题库(含答案)
- 免疫治疗免疫相关不良反应的处理PowerPoint-演示文稿
- 研究生英语翻译答案
- GB 15607-2023涂装作业安全规程粉末静电喷涂工艺安全
- 手表买卖合同协议书
- 2023门面装修合同范本
- DB34-T 4170-2022 软阔立木材积表
- 汽车租赁有限公司车队及车辆管理制度
评论
0/150
提交评论