您现在的位置是:经典90版hpg电子娱乐游戏a闲和庄怎么玩pptml坦克大战小游戏代码 >>正文
经典90版hpg电子娱乐游戏a闲和庄怎么玩pptml坦克大战小游戏代码
安邦治国网3人已围观
简介演示地址http://www.bokequ.com/show/youxi/1/电脑键盘操作说明:玩家1:wasd上左下右,n下一关,html页面代码<!DOCTYPE html><h...
演示地址http://www.bokequ.com/show/youxi/1/
电脑键盘操作说明:
玩家1:wasd上左下右,n下一关,
html页面代码
<!DOCTYPE html><html lang="zh" class="no-js demo-1"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="js/jquery.min.js"></script> <script src="js/Helper.js"></script> <script src="js/keyboard.js"></script> <script src="js/const.js"></script> <script src="js/level.js"></script> <script src="js/crackAnimation.js"></script> <script src="js/prop.js"></script> <script src="js/bullet.js"></script> <script src="js/tank.js"></script> <script src="js/num.js"></script> <script src="js/menu.js"></script> <script src="js/map.js"></script> <script src="js/Collision.js"></script> <script src="js/stage.js"></script> <script src="js/main.js"></script> <link rel="stylesheet" type="text/css" href="css/default.css" /> <style type="text/css"> #canvasDiv canvas{ position:absolute; } </style> </head> <body> <div class="container"> <head> <h3>操作说明:玩家1:wasd上左下右,space(空格键)射击;玩家2:方向键,坦克页面小游戏,2:展开 this.isReady = false;//标识地图是否已经画好 this.levelNum = new Num(context); this.init = function(level){ this.dir = 1; this.isReady = false; this.level = level; this.temp = 0; }; this.draw = function(){ if(this.dir == 1){ //temp = 15*15 灰色屏幕已经画完 if(this.temp == 225){ //78,14为STAGE字样在图片资源中的宽和高,enter射击。space(空格键)射击;$$闲和庄怎么玩$$$$玩家2:方向键,pg电子娱乐游戏app194,208为canvas中的位置 this.ctx.drawImage(RESOURCE_IMAGE, POS["stageLevel"][0], POS["stageLevel"][1], 78, 14, 194, 208, 78, 14); //14为数字的宽和高,经典90版html坦克大战游戏代码。p上一关。enter射击。308, 208为canvas中的位置 this.levelNum.draw(this.level,308, 208); //this.ctx.drawImage(RESOURCE_IMAGE,POS["num"][0]+this.level*14,POS["num"][1],14, 14,308, 208,14, 14); //绘制地图,调用main里面的方法 initMap(); }else if(this.temp == 225 + 600){ //600即调用了600/15次,</h3> </head> <div class="main clearfix"> <div id="canvasDiv" > <canvas id="wallCanvas" ></canvas> <canvas id="tankCanvas" ></canvas> <canvas id="grassCanvas" ></canvas> <canvas id="overCanvas" ></canvas> <canvas id="stageCanvas" ></canvas> </div> </div> </div><!-- /container --> </body></html>
部分js代码
var Stage = function(context,l){ this.ctx = context; this.ctx.fillStyle = "#7f7f7f"; this.drawHeigth = 15; this.level = l; this.temp = 0; this.dir = 1; //中间切换的方向,闲和庄怎么玩网页坦pg电子娱乐游戏app克大战小游戏源码,1:合上,n下一关,p上一关。主要用来停顿 this.temp = 225; this.dir = -1; START_AUDIO.play(); }else{ this.ctx.fillRect(0, this.temp, 512, this.drawHeigth); this.ctx.fillRect(0, 448 - this.temp - this.drawHeigth , 512, this.drawHeigth); } }else{ if(this.temp >= 0){ this.ctx.clearRect(0, this.temp , 512, this.drawHeigth); this.ctx.clearRect(0, 448 - this.temp - this.drawHeigth, 512, this.drawHeigth); }else{ this.isReady = true; } } this.temp += this.drawHeigth * this.dir; };};
Tags:
上一篇:CSS3文本效果text
相关文章
web前端CSS传统布局position属性
经典90版hpg电子娱乐游戏a闲和庄怎么玩pptml坦克大战小游戏代码一、定位布局在使用定位布局前,先了解一下定位属性的用法。CSS2 提供了 position 属性来实现元素的绝对定位和相对定位。属性说明static默认值,无定位。absolute绝对定位,使用 to...
阅读更多
wordpress博客头部wp
经典90版hpg电子娱乐游戏a闲和庄怎么玩pptml坦克大战小游戏代码如果网页打开速度过低,不但影响用户的访问,还有可能降权。再好的网站,如果打开速度慢,多数用户都不会停留的。对个人网站非常不利。而影响网站打开速度常见有服务器配置、性能、传输等问题,还有一个就是网站本身...
阅读更多
个人博客主页如何做网站优化
经典90版hpg电子娱乐游戏a闲和庄怎么玩pptml坦克大战小游戏代码博客简言之就是以网络作为载体,简易迅速便捷地发布自己的心得,及时有效轻松地与他人进行交流,再集丰富多彩的个性化展示于一体的综合性平台,是我们企业或者个人在网络平台上的一个身份证明。我们通常说的博客一般...
阅读更多