




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
一款基础模型的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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 北京工具式马道施工方案
- 世界肾脏日活动策划方案
- 残疾人社区营销活动方案
- 广东文旅水景施工方案
- 药品安全培训会议药监局课件
- 景观方案阶段设计合同5篇
- 《2024 秋季学期开学第一天学生安全方案》
- 图书馆管理系统系统分析
- 建筑单位大门建设方案设计
- 中国农业现代化发展策略
- 华为TaiShan200-X6000服务器技术白皮书
- 地质勘查单位安全检查表-(修订本)
- 解读《义务教育体育与健康课程标准(2022年版)》2022年体育与健康新课标专题PPT
- GB∕T 40853.1-2021 高频感性元件 电特性及其测量方法 第1部分:纳亨级片
- 建筑识图题库及答案
- 氨基酸溶解性(共1页)
- GDX2包装机组工艺流程简介
- 张家口至涿州公路张家口段(含连接线)建设项目水资源论
- 异质结TCO设备:RPD与PVD比较分析(2021年).doc
- 苏教版六年级上册科学实验教学计划
- 螺纹知识 (4)
评论
0/150
提交评论