为什么要把游戏的加载时间控制在30秒以内还原魔方公式

(ERROR:15) & 访客不能直接访问复制地址:
小游戏,大乐趣
1.按键操作
arrows移动
2.如何开始
点击play开始游戏。
3.游戏目标
你认为自己是一个游戏高手吗?那就试着撑过30秒吧!
7K7K网页游戏
7K7K儿童游戏
法律顾问:北京市诺恒律师事务所
京公网安备37
游戏作品版权归原作者享有,如无意之中侵犯了您的版权,请您按照来信告知,本网站将应您的要求删除。
7k7k小游戏温馨提示:适度游戏娱乐,沉迷游戏伤身,合理安排时间,享受快乐生活……
该游戏已收藏HTML5 小游戏:是男人就撑过30秒_Linux编程_Linux公社-Linux系统门户网站
你好,游客
HTML5 小游戏:是男人就撑过30秒
来源:Linux社区&
话不多说HTML5
图画板写的一个小游戏,原形为是男人就撑过30秒。
下载地址:
免费下载地址在
用户名与密码都是
具体下载目录在 /2012年资料/1月/30日/HTML5 小游戏:是男人就撑过30秒/
演示地址:
上下左右控制 ctrl键可加速
player是小球
star是怪物
请用支持canvas的浏览器访问 推荐用 firefox 或chrome
&!DOCTYPE&HTML&&
&http-equiv="Content-Type"&content="text/&charset=utf-8"&&
HTML5游戏:是男人就撑过30秒 || <A href="&&
&language="javascript"&type="text/javascript"&&
//定义键盘值&&
var&KEY&=&{&D:&68,&W:&87,&A:&65,&S:83,&RIGHT:39,&UP:38,&LEFT:37,&DOWN:40,&QUICK:17};&&
//定义输入对象&&
var&input&=&{&&
&&&&right&&&:&false,&&
&&&&up&&:&false,&&
&&&&left&&&&:&false,&&
&&&&down&&&&:&false,&&
&&&&quick&&&:&false&&
//小球对象&&
var&player&=&{&&
&&&&speed&&&:&1,&&
&&&&qspeed&&:&2,&&
&&&&left&&&&:&0,&&
&&&&top&:&0,&&
&&&&xleft&&&:&0,&&
&&&&dleft&&&:&0,&&
&&&&xtop&&&&:&0,&&
&&&&dtop&&&&:&0,&&
&&&&r&&&:&5&&
player.init&=&function(){&&
&&&&thisthis.xleft&=&this.r;&&
&&&&thisthis.xtop&=&this.r;&&
&&&&this.dleft&=&$("myCanvas").width-this.r;&&
&&&&this.dtop&=&$("myCanvas").height-this.r;&&
&&&&this.left&=&$("myCanvas").width/2;&&
&&&&this.top&=&$("myCanvas").height/2;&&
player.getSpeed&=&function(){&&
&&&&return&(input.quick?this.qspeed:this.speed);&&
player.update&=&function(){&&&
&&&&if&(input.right)&&&&player.left+=player.getSpeed();&&
&&&&if&(input.left)&&&&&playerplayer.left-=player.getSpeed();&&
&&&&if&(input.down)&&&&&player.top+=player.getSpeed();&&
&&&&if&(input.up)&&&&&&&playerplayer.top-=player.getSpeed();&&
&&&&if&(player.leftplayer.dleft)&&&&playerplayer.left=player.&&
&&&&if&(player.left)&&&&playerplayer.left=player.&&
&&&&if&(player.topplayer.dtop)&&playerplayer.top=player.&&
&&&&if&(player.top)&&playerplayer.top=player.&&
&&&&var&c=$("myCanvas");&&
&&&&var&ccxt=c.getContext("2d");&&&&&&&
&&&&cxt.fillStyle="#FF0000";&&
&&&&cxt.beginPath();&&
&&&&cxt.arc(player.left,player.top,player.r,0,Math.PI&*&2,true);&&
&&&&cxt.closePath();&&
&&&&cxt.fill();&&
var&star&=&function(){&&
&&&&this.x&=&0;&&
&&&&this.y&=&0;&&
&&&&this.r&=&5;&&
&&&&this.c&=&"#00FF00";&&
&&&&this.ax&=&0;&&
&&&&this.ay&=&0;&&
&&&&this.a&=&0;&&
&&&&this.rAngle&=&0;&&
&&&&this.speed&=&0;&&
&&&&this.isAddX&=&true;&&
&&&&this.isAddY&=&true;&&
&&&&this.init&=&function(){&&
&&&&&&&&var&lon&=&($("myCanvas").width+$("myCanvas").height)*2;&&
&&&&&&&&var&rlon&=&Math.floor(Math.random()*(lon+1));&&
&&&&&&&&this.rAngle&=&Math.floor(Math.random()*91);&&
&&&&&&&&if(rlon$("myCanvas").width){//上&&
&&&&&&&&&&&&this.x&=&rlon;&&
&&&&&&&&&&&&this.y&=&0;&&
&&&&&&&&}else&if(rlon$("myCanvas").width+$("myCanvas").height){//右&&
&&&&&&&&&&&&this.x&=&$("myCanvas").&&
&&&&&&&&&&&&this.y&=&rlon-$("myCanvas").&&
&&&&&&&&}else&if(rlon$("myCanvas").width*2+$("myCanvas").height){//下&&
&&&&&&&&&&&&this.x&=&$("myCanvas").width&-&(rlon-$("myCanvas").width-$("myCanvas").height);&&
&&&&&&&&&&&&this.y&=&$("myCanvas").&&
&&&&&&&&}else{//左&&
&&&&&&&&&&&&this.x&=&0;&&
&&&&&&&&&&&&this.y&=&$("myCanvas").height-(rlon-$("myCanvas").width*2-$("myCanvas").height);&&
&&&&&&&&}&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&if(rlon$("myCanvas").width/2&||&rlon$("myCanvas").width*2+$("myCanvas").height+$("myCanvas").height/2){//左上&&
&&&&&&&&&&&&this.isAddX&=&true;&&
&&&&&&&&&&&&this.isAddY&=&true;&&
&&&&&&&&}else&if(rlon$("myCanvas").width+$("myCanvas").height/2){//右上&&
&&&&&&&&&&&&this.isAddX&=&false;&&
&&&&&&&&&&&&this.isAddY&=&true;&&
&&&&&&&&}else&if(rlon$("myCanvas").width+$("myCanvas").height+$("myCanvas").width/2){//右下&&
&&&&&&&&&&&&this.isAddX&=&false;&&
&&&&&&&&&&&&this.isAddY&=&false;&&
&&&&&&&&}else{//左下&&
&&&&&&&&&&&&this.isAddX&=&true;&&
&&&&&&&&&&&&this.sAddY&=&false;&&
&&&&&&&&}&&
&&&&&&&&this.ax&=&Math.sin(Math.PI/180*this.rAngle)*star.&&
&&&&&&&&thisthis.ax&=&this.isAddX?this.ax:0-this.&&
&&&&&&&&this.ay&=&Math.cos(Math.PI/180*this.rAngle)*star.&&
&&&&&&&&thisthis.ay&=&this.isAddY?this.ay:0-this.&&
&&&&this.update&=&function(){//更新&&
&&&&&&&&thisthis.x=this.x+this.&&
&&&&&&&&thisthis.y=this.y+this.&&
&&&&&&&&&&
&&&&&&&&if((this.isAddX&&&&this.x$("myCanvas").width)&||&(!this.isAddX&&&&this.x)&||&(this.isAddY&&&&this.y$("myCanvas").height)&||&(!this.isAddY&&&&this.y)){&&
&&&&&&&&&&&&this.init();&&
&&&&&&&&&&&&&&
&&&&&&&&}&&
&&&&&&&&&&
&&&&&&&&//$("message").innerHTML&=&$("message").innerHTML+"&x="+this.x+";y="+this.y;&&
&&&&&&&&//$("message").innerHTML&=&$("message").innerHTML+"cxt.arc("+Math.round(this.x)+","+Math.round(this.y)+","+this.r+",0,Math.PI&*&2,true)";&&
&&&&&&&&var&c=$("myCanvas");&&
&&&&&&&&var&ccxt=c.getContext("2d");&&&&&&&
&&&&&&&&cxt.fillStyle=this.c;&&
&&&&&&&&cxt.beginPath();&&
&&&&&&&&cxt.arc(this.x,this.y,this.r,0,Math.PI&*&2,true);&&
&&&&&&&&cxt.closePath();&&
&&&&&&&&cxt.fill();&&
&&&&this.iscollide&=&function(){//判断是否被撞到&&
&&&&&&&&var&x&=&Math.abs(player.left-this.x);&&
&&&&&&&&var&y&=&Math.abs(player.top-this.y);&&
&&&&&&&&var&R&=&this.r+player.r;&&
&&&&&&&&if(R*R&&*x+y*y){&&
&&&&&&&&&&&&return&&&
&&&&&&&&}&&
&&&&&&&&return&&&
star.speed&=&1;&&
var&press&=&function(event){&&
&&&&var&code&=&event.keyCode&||&window.&&
&&&&switch(code)&{&&
&&&&&&&&case&KEY.RIGHT:&&
&&&&&&&&case&KEY.D:&input.right&=&true;&&&
&&&&&&&&case&KEY.UP:&&
&&&&&&&&case&KEY.W:&input.up&=&true;&&&
&&&&&&&&case&KEY.LEFT:&&
&&&&&&&&case&KEY.A:&input.left&=&true;&&&
&&&&&&&&case&KEY.DOWN:&&
&&&&&&&&case&KEY.S:&input.down&=&true;&&&
&&&&&&&&case&KEY.QUICK:&input.quick&=&true;&&&
var&release&=&function(event)&{&&
&&&&var&code&=&event.keyCode&||&window.&&
&&&&switch(code)&{&&
&&&&&&&&case&KEY.RIGHT:&&
&&&&&&&&case&KEY.D:&input.right&=&false;&&&
&&&&&&&&&&
&&&&&&&&case&KEY.UP:&&
&&&&&&&&case&KEY.W:&input.up&=&false;&&&
&&&&&&&&&&
&&&&&&&&case&KEY.LEFT:&&
&&&&&&&&case&KEY.A:&input.left&=&false;&&&
&&&&&&&&&&
&&&&&&&&case&KEY.DOWN:&&
&&&&&&&&case&KEY.S:&input.down&=&false;&&&
&&&&&&&&&&
&&&&&&&&case&KEY.QUICK:&input.quick&=&false;&&&
var&stars&=&new&Array();&&
var&time&=&0;&&
//加载事件&&
var&load&=&function(){&&
&&&&player.init();&&
&&&&for(i=0;i;i++){&&
&&&&&&&&var&s&=&new&star();&&
&&&&&&&&s.init();&&
&&&&&&&&stars[i]&=&s;&&
&&&&begin&=&new&Date();&&
&&&&myInter&=&setInterval(function(){update();},20);&&
var&$&=&function(id){&&
&&&&return&document.getElementById(id);&&
//更新方法&&
var&update&=&function(){&&
&&&&var&c=$("myCanvas");&&
&&&&cc.width&=&c.&//&Clears&the&canvas&&&&
&&&&player.update();&&
&&&&for(i=0;i;i++){&&
&&&&&&&&stars[i].update();&&
&&&&updatetime();&&
&&&&isDead();&&
//更新时间&&
var&updatetime&=&function(){&&&&&&
&&&&var&end&=&new&Date();&&
&&&&var&time&=&Math.round((end-begin)/1000);&&
&&&&star.speed&=&Math.round(time/10);&&
&&&&$("time").innerHTML&=&time;&&
//判断是否死了&&
var&isDead&=&function(){&&
&&&&for(i=0;i;i++){&&
&&&&&&&&var&flag&=&stars[i].iscollide();&&
&&&&&&&&if(flag==false){&&
&&&&&&&&&&&&clearInterval(myInter);&&
&&&&&&&&&&&&alert("失败了");&&
&&&&&&&&&&&&&&
&&&&&&&&}&&
&onLoad="load();"&onkeydown="press(event);"&onkeyup="release(event);"&&&
&&&&&id="myCanvas"&width="400"&height="400"&style="&border:2px&solid&#F00;&left:30%;&position:&"&&
&&&&换个好浏览器吧,ie太垃圾了&&
&&&&&id="message"&&
&&&&兼容&wasd&和&↑←↓→&&
&&&&ctrl&键加速&&
&&&&&id="time"秒&&
相关资讯 & & &
& (03月06日)
& (03月03日)
& (04月10日)
& (03月06日)
& (01月17日)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款苹果园为iOS用户提供和下载,最新的、、、等,分享最权威的资讯、、及解决办法,拥有最火爆的,苹果园一家专注解决iOS所求的网站。

我要回帖

更多关于 30秒开锁游戏 的文章

 

随机推荐