小米2a怎么样样可以在第八源码网上投放广告?

卡卡灣渡假村娱乐城博彩投注-时时彩网站源码/江西时时彩开奖记录
            
&财务处圆满完成对的经费保障调研任务
&转播:国务院召开深入贯彻落实《国务院关于进一步加强工作的意见》电视电话会议[图文]
&迅速研究贯彻国务院电视电话会议精神[图文]
&深入支检查指导“七?一”等大型活动安全保卫工作[图文]
&亲临支检查指导基层基础建设工作
&《人民报》刊登郭铁男长文章《构筑社会主义新农村安全基础》
&新华视点:从督透视我国公共安全形势(转载)[图文]
&吉林辽源医院事故死亡人数升至39人[图文]
&俄罗斯莫斯科一医院发生
&缅甸仰光市发生 1962个家庭无家可归
&本应急管理信息系统建设模式及借鉴
&美洲豹机场救援车介绍[图文]
&本东京厅装备[图文]
&美国出台床垫易燃性强制标准 起生效
&各国教育集锦
&1-综合情况
&平安县发生一起溺水事件
&山下突发交通事故 再演感人一幕
&锅炉房粉尘爆炸 排险情
&市家庭、餐馆势头上升
消 防 论 坛
用户姓名:
用户密码:
  行业资讯
  面对井喷式团购繁荣带来的问题,国内一些主流团购网站也开时时彩网站源码/江西时时彩开奖记录始制定一些相应对策。比如美团网、拉手网等均通过分阶段结算来保证商家履约。拉手网还针对商家订下了50条戒律,如有无消费者投诉、有卡卡灣渡假村娱乐城博彩投注无网上差评等,商家一旦触及这些“红线”,将终止与其合作等。
  美东时间5月10日11:57(北京时间5月10日23:57),道琼斯工业平均指数上涨39.66点,报12,874.72点,涨幅为0时时彩网站源码/江西时时彩开奖记录.31%;纳斯达克(微博)综合指数下跌5.24点,报2,929.47点,跌幅为0.18%;标准普尔500指数上涨4.68点,报1,359.26点,涨幅为0.35%。
  如果你关注过《完美世界》、时时彩网站源码/江西时时彩开奖记录《武林外传》、《诛仙2》、《赤壁》、《梦幻诛仙》等游戏,那么对这家叫做完美世界(PWRD.NASDAQ)卡卡灣渡假村娱乐城博彩投注的中国概念上市公司一定不陌生。
  跑业务的张先生深有同感,通常他的车子一个月要加3次时时彩网站源码/江西时时彩开奖记录汽油,“这次油价上调后,加满一箱油差不多要480元,跟没有提价前相比,一箱油的差价相当于一包好烟的钱。”
  甘剑平欣赏巴菲特的投资理念,不熟的不做。他更喜欢从战略层面对时时彩网站源码/江西时时彩开奖记录一家企业进行规划和指导,而不卡卡灣渡假村娱乐城博彩投注是具体去负责企业日常运营。有时候,知道怎么做比具体做什么更重要。
  盛大网络第一季度回购了151,793股美国存托股份。
  “地震后,身边的人第一反应都时时彩网站源码/江西时时彩开奖记录是打电话,但无法接通;发短消息要么发不出,要么发出后对方无法收到。”在东京留学的严军(化名)告诉《每日经济新闻》记者,随后大家发现,Twitter、Facebook、Mix(日本最大的SNS网站)仍可以通过手机登录。而这些网站成了震后许多日本居民交互信息的重要“生命线”。
  基尼·蒙斯特:这么说独家内容占所有内容的比例将低于50%?
  近年来,卡卡灣渡假村娱乐城博彩投注整个互联网甚时时彩网站源码/江西时时彩开奖记录至包括移动互联网越来越细分化,在用户的选择多了的同时,也意味着很难去抓住用户上网行为。对此,网秦表示,在移动互联网领域,不排除做任何业务的可能,只要是能抓住用户能带来利润点的业务都会去尝试。
  通常情况下,电商SKU计划的后时时彩网站源码/江西时时彩开奖记录期调整周期会定期进行,一般一个季度一次。SKU计划调整的周期一方面能够反映出电商对于外部环境的应对能力,另一方面也有助于商城/渠道店铺进行更好的市场定位。
上一篇:下一篇:
& &&&&本站的信息量不断的增加,你比较喜欢浏览哪些栏目?&
建议使用IE5.0或以上版本浏览器,屏幕像素800*600或分辨率
版权所有:应急管理信息系统建设模式及借鉴要点站长之家通告:
.wang王牌域名
我的14年互联网“淘金史”
马佳佳“High”暴强颠覆股票/基金&
汤森路透Eikon平台新增芝商所大宗商品交易通道
作者:汤森路透
  汤森路透Eikon平台新增芝商所交易通道,与CME Direct达成协议加强了交易能力。
  日―汤森路透今日宣布与芝加哥商业交易所集团(CME
Group)达成协议,为进一步加大大宗商品市场流动性提供了途径。汤森路透Eikon注册了芝加哥商业交易所集团交易的用户可以链接到CME Direct
,通过这一商品、期权、场外交易市场的前端平台进行交易。这一合作使大宗商品的专业人士在汤森路透的Eikon平台中自由浏览新闻、使用制图软件、图表分析等工具的同时,还能够直接进入CME
Direct的电子系统。
  双方的协议覆盖了芝加哥商业交易所集团的能源、金属和(,)的全部期货、期权和场外交易市场,令Eikon及CME
Direct的客户能够更容易地进行研究和交易管理。资产类别覆盖的范畴包括纽约商业交易所(NYMEX)的能源,芝加哥商品交易所(COMEX)的金属和芝加哥商品期货交易所(CBOT)的农产品等。
  这次升级进一步扩大了商品市场的流动性。汤森路透还实现了此前与CQG交易平台签署的一份协议,增加了与65个期货经纪公司直接连接。
  “衍生性金融商品倍受推崇的大环境使金融市场的参与者开始寻找一种简单便捷的方法来进行分析研究和实现商品交易。”汤森路透大宗商品总经理Shaun
Sibley说:“在Eikon原有的新闻和分析服务功能上加大商品流动性,这无疑能使我们的客户能够更有效地制定和执行交易策略。”
  “我们非常高兴能够和汤森路透合作,让我们共同的客户能够通过CME Direct平台了解商品市场的同时,使用Eikon强大的新闻软件和分析工具。”芝加哥商业交易所集团解决方案总经理Michel
Everaert说:“双方的合作为我们的客户在瞬息万变的行业环境中提供了强大的交易工具。”
  汤森路透Eikon是功能强大的新一代金融信息服务解决方案,帮助客户获取实时和历史,有效连接各个金融市场,实现金融市场交易。屡获殊荣的新闻信息、数据分析和数据可视化工具,帮助用户快速有效地实现商品、衍生性商品、、固定收益和外汇等跨资产类别交易和投资决策。汤森路透Eikon是领先的终端及智能移动解决方案,为超过21万金融专业人士提供信息化社区。
  使用CME Direct和汤森路透Eikon的用户必须注册成为芝加哥商业交易所集团和场外交易市场的交易客户。
(责任编辑:HF028)
07/14 06:3807/12 09:5806/26 11:24
暂无专家推荐本文
同时转发到我的微博
将自动提交到和讯看点,
请输入您的观点并提交。
请输入您的观点 168字以内
同时转发到我的微博置顶我的观点
期货精品推荐
每日要闻推荐
社区精华推荐
精彩策划推荐
  【独家稿件声明】凡注明“和讯”来源之作品(文字、图片、图表),未经和讯网授权,任何媒体和个人不得全部或者部分转载。如需转载,请与010-联系;经许可后转载务必请注明出处,并添加源链接,违者本网将依法追究责任。&  前几天粗略地学了HTML5,然后就用它写了一个《经典坦克大战》游戏。  现在想分享一下我写的代码,写得不好请大家多多指教。  游戏网站:/  给大家推荐一个网站,这个网站是为大学生而做,为方便学习编程的同学而做的。(淘课学院)/  &《经典坦克大战》游戏截图 1 &!DOCTYPE html& 2 &html ="http://www.w3.org/1999/xhtml"& 3 &head& 4
&meta http-equiv="Content-Type" content="text/ charset=utf-8" /& 5
&meta charset="utf-8" /& 6
&title&HTML5经典坦克大战&/title& 7
&script src="jquery-1.10.2.min.js"&&/script& 8
&style type="text/css"& 9
margin: 0px 011
padding: 0px 012
margin-left:15
margin-right:16
width: 65017
&/style&19 &/head&20 &body onkeydown="getCommand()"&21
&div class="con"&22
&h1&HTML5&&经典坦克大战&/h1&23 24
&canvas id="tankmap" width="600" height="500" style="background-color:#000;"&&/canvas&25
&div style="margin-top:20font-weight:font-size:20color:"&26
W、S、A、D分别控制:上、下、左、右;J是发子弹。暂时不支持Firefox浏览器。27
&/div&29 30
&script type="text/javascript"&31
var gameover =32
var verygood =33
var canH = document.getElementById("tankmap");34
var cxt = canH.getContext("2d");35 36
var bomb3 = new Image();37
bomb3.src = "images/bomb_3.gif";38
var bomb2 = new Image();39
bomb2.src = "images/bomb_2.gif";40
var bomb1 = new Image();41
bomb1.src = "images/bomb_1.gif";42 43
var born1 = new Image();44
born1.src = "images/born1.gif";45
var born2 = new Image();46
born2.src = "images/born2.gif";47
var born3 = new Image();48
born3.src = "images/born3.gif";49
var born4 = new Image();50
born4.src = "images/born4.gif";51 52
var buBoImg = new Image();53
buBoImg.src = "images/blast1.gif";54 55
var base1 = new Image();56
base1.src = "images/symbol.gif";57
var base2 = new Image();58
base2.src = "images/destory.gif";59 60
&/script&61
&script src="Draw.js"&&/script&62
&script src="opera_js.js"&&/script&63 &/body&64 &/html&65 66 HTML页HTML页
1 ///玩家坦克颜色(机身颜色,盖子颜色)
2 var heroColor1 = new Array("#ba9658", "#fef26e");
3 var heroColor2 = new Array("#00a2b5", "#00fefe");
5 ///敌人坦克颜色(机身颜色,盖子颜色)
6 var enemyColor1 = new Array("#006f43", "#43b387");
7 var enemyColor2 = new Array("#f00", "#e34444");
8 var enemyColor3 = new Array("#fa02e6", "#d45bca");
9 var enemyColor4 = new Array("#0600fd", "#3531c4"); 10
12 ///敌人子弹数组 13 var enemyBullets = new Array(null, null, null, null, null, null, null, null, null, null, 14
null, null, null, null, null, null, null, null, null, null); 15 ///敌人子弹爆炸数组 16 var enemyBulletBombs = new Array(null, null, null, null, null, null, null, null, null, null, 17
null, null, null, null, null, null, null, null, null, null); 18 ///定义玩家子弹数组 19 var hero1bullet = 20 var hero1bulletBomb = 21
22 ////出身效果 23 function Born(x, y) { 24
this.x = 25
this.y = 26
this.time = 0; 27
this.born = 28
this.drawBorn = function drawBorn() { 31
if (this.time &= 1) { 32
cxt.drawImage(born1, this.x, this.y, 50, 50); 33
if (this.time & 1 && this.time &= 3) { 35
cxt.drawImage(born2, this.x, this.y, 50, 50); 36
if (this.time &= 4 && this.time &= 5) { 38
cxt.drawImage(born3, this.x, this.y, 50, 50); 39
if (this.time &= 6 && this.time &= 7) { 41
cxt.drawImage(born4, this.x, this.y, 50, 50); 42
if (this.time &= 8 && this.time &= 9) { 44
cxt.drawImage(born2, this.x, this.y, 50, 50); 45
if (this.time &= 10 && this.time &= 11) { 47
cxt.drawImage(born3, this.x, this.y, 50, 50); 48
if (this.time &= 12 && this.time &= 13) { 50
cxt.drawImage(born4, this.x, this.y, 50, 50); 51
this.time++; 54
if (this.time &= 13) { 55
this.born = 56
this.time = 0; 57
61 ////坦克类 62 function Tank(x, y, speed, direct, tankcolor, islive) 63 { 64
this.x = 65
this.y = 66
this.speed = 67
this.direct = 68
this.tankcolor = 69
this.islive = 70
this.moveUp = function () 72
this.y = this.y - this. 74
if (this.y &= 0) 75
this.y = 0; 77
this.direct = 0; 79
this.moveDown = function () 81
this.y = this.y + this. 83
if (this.y &= 450) 84
this.y = 450; 86
this.direct = 2; 88
this.moveLeft = function () 90
this.x = this.x - this. 92
if (this.x &= 0) 93
this.x = 0; 95
this.direct = 3; 97
this.moveRight = function () 99
this.x = this.x + this. 101
if (this.x &= 550) 102
this.x = 550; 104
this.direct = 1; 106
} 107 } 108
109 ///玩家坦克类,继承于坦克类(Tank) 110 function Hero(x, y, speed, direct, tankcolor, islive) 111 { 112
this.tank = T 113
this.tank(x, y, speed, direct, tankcolor, islive); 114
this.attackEnemy = function () 118
if (hero1bullet != null) 120
switch (this.direct) 124
case 0: 126
hero1bullet = new Bullet(this.x + 24, this.y, 4, 0); 127 128
case 1: 129
hero1bullet = new Bullet(this.x + 50, this.y + 24, 4, 1); 130 131
case 2: 132
hero1bullet = new Bullet(this.x + 24, this.y + 50, 4, 2); 133 134
case 3: 135
hero1bullet = new Bullet(this.x, this.y + 24, 4, 3); 136 137
hero1bullet.time = window.setInterval("hero1bullet.run('h')", 20); 139
} 140 } 141 ///敌人坦克类,继承坦克类(Tank) 142 function Enemy(x, y, speed, direct, tankcolor, islive) 143 { 144
this.tank = T 145
this.tank(x, y, speed, direct, tankcolor, islive); 146
///敌人移动 147
this.run = function () 148
if (this.islive == 0) 150
this.changeDir(); 154
switch (this.direct) 155
case 0: 157
if (this.y &= 0) 158
this.beyondChange(); 160
if (!this.enemyTankCollision(this)) { 162
this.moveUp(); 163
case 1: 166
if (this.x &= 550) 167
this.beyondChange(); 169
if (!this.enemyTankCollision(this)) 171
this.moveRight(); 173
case 2: 176
if (this.y &= 450) 177
this.beyondChange(); 179
if (!this.enemyTankCollision(this)) { 181
this.moveDown(); 182
case 3: 185
if (this.x &= 0) 186
this.beyondChange(); 188
if (!this.enemyTankCollision(this)) { 190
this.moveLeft(); 191
this.changeDir = function () 196
var dri_num = Math.round(Math.random() * 99); 198
if (dri_num & 4) { 199
this.direct = Math.round(Math.random() * 3); 200
this.beyondChange = function () { 203
this.direct = Math.round(Math.random() * 3); 204
///敌人攻击 207
this.attackEnemy = function (en) 208
if (enemyBullets[en] != null) 210
if ((Math.round(Math.random() * 99)) & 4) 214
switch (this.direct) { 216
case 0: 217
enemyBullets[en] = new Bullet(this.x + 24, this.y, 4, 0); 218 219
case 1: 220
enemyBullets[en] = new Bullet(this.x + 50, this.y + 24, 4, 1); 221 222
case 2: 223
enemyBullets[en] = new Bullet(this.x + 24, this.y + 50, 4, 2); 224 225
case 3: 226
enemyBullets[en] = new Bullet(this.x, this.y + 24, 4, 3); 227 228
enemyBullets[en].time = window.setInterval("enemyBullets[" + en + "].run(" + en + ")", 20); 231
///敌人坦克碰撞 234
this.enemyTankCollision = function (enemy1) 235
var enemy2 = 238
for (var en2 = 0; en2 & enemys. en2++) 240
enemy2 = enemys[en2]; 242
if (enemy2 != null && enemy2.islive != 0) 243
switch (enemy1.direct) { 245
case 0: 246
if ((hero1 != null && hero1.islive != 0) && (enemy1.x & hero1.x - 50) && (enemy1.x & hero1.x + 50) && 247
((enemy1.y == hero1.y + 47) || (enemy1.y == hero1.y + 50) || (enemy1.y == hero1.y + 49) || (enemy1.y == hero1.y + 48))) { 248
if ((enemy1.x & enemy2.x - 50) && (enemy1.x & enemy2.x + 50) && 251
((enemy1.y == enemy2.y + 47) || (enemy1.y == enemy2.y + 50) || (enemy1.y == enemy2.y + 49) || (enemy1.y == enemy2.y + 48))) { 252
case 1: 257
if ((hero1 != null && hero1.islive != 0) && (enemy1.y & hero1.y - 50) && (enemy1.y & hero1.y + 50) && 258
((enemy1.x + 47 == hero1.x) || (enemy1.x + 50 == hero1.x) || (enemy1.x + 49 == hero1.x) || (enemy1.x + 48 == hero1.x))) { 259
if ((enemy1.y & enemy2.y - 50) && (enemy1.y & enemy2.y + 50) && 262
((enemy1.x + 47 == enemy2.x) || (enemy1.x + 50 == enemy2.x) || (enemy1.x + 49 == enemy2.x) || (enemy1.x + 48 == enemy2.x))) { 263
case 2: 267
if ((hero1 != null && hero1.islive != 0) && (enemy1.x & hero1.x - 50) && (enemy1.x & hero1.x + 50) && 268
((enemy1.y == hero1.y - 47) || (enemy1.y == hero1.y - 50) || (enemy1.y == hero1.y - 49) || (enemy1.y == hero1.y - 48))) { 269
if ((enemy1.x & enemy2.x - 50) && (enemy1.x & enemy2.x + 50) && 272
((enemy1.y == enemy2.y - 47) || (enemy1.y == enemy2.y - 50) || (enemy1.y == enemy2.y - 49) || (enemy1.y == enemy2.y - 48))) { 273
case 3: 277
if ((hero1 != null && hero1.islive != 0) && (enemy1.y & hero1.y - 50) && (enemy1.y & hero1.y + 50) && 278
((enemy1.x - 47 == hero1.x) || (enemy1.x - 50 == hero1.x) || (enemy1.x - 49 == hero1.x) || (enemy1.x - 48 == hero1.x))) { 279
if ((enemy1.y & enemy2.y - 50) && (enemy1.y & enemy2.y + 50) && 282
((enemy1.x - 47 == enemy2.x) || (enemy1.x - 50 == enemy2.x) || (enemy1.x - 49 == enemy2.x) || (enemy1.x - 48 == enemy2.x))) { 283
///敌人坦克与阻碍物之间碰撞 292
var hamper = 293
for (var ha = 0; ha & hampers. ha++) 294
hamper = hampers[ha]; 296
if (hamper != null) 297
switch (hampers[ha].style) { 299
case 1: 300
switch (enemy1.direct) { 301
case 0: 302
if ((enemy1.x &= hamper.x - 50) && (enemy1.x &= hamper.x + 17) && 303
((enemy1.y == hamper.y + 7) || (enemy1.y == hamper.y + 8) || (enemy1.y == hamper.y + 9) || (enemy1.y == hamper.y + 10))) { 304
case 1: 308
if ((enemy1.y & hamper.y - 50) && (enemy1.y & hamper.y + 10) && 309
((enemy1.x + 50 == hamper.x) || (enemy1.x + 49 == hamper.x) || (enemy1.x + 48 == hamper.x) || (enemy1.x + 47 == hamper.x))) { 310
case 2: 314
if ((enemy1.x & hamper.x - 50) && (enemy1.x & hamper.x + 17) && 315
((enemy1.y + 50 == hamper.y) || (enemy1.y + 49 == hamper.y) || (enemy1.y + 48 == hamper.y) || (enemy1.y + 47 == hamper.y))) { 316
case 3: 320
if ((enemy1.y & hamper.y - 50) && (enemy1.y & hamper.y + 10) && 321
((enemy1.x == hamper.x + 17) || (enemy1.x == hamper.x + 16) || (enemy1.x == hamper.x + 15) || (enemy1.x == hamper.x + 14))) { 322
case 2: 328
switch (enemy1.direct) { 329
case 0: 330
if ((enemy1.x &= hamper.x - 50) && (enemy1.x &= hamper.x + 17) && 331
((enemy1.y == hamper.y + 14) || (enemy1.y == hamper.y + 15) || (enemy1.y == hamper.y + 16) || (enemy1.y == hamper.y + 17))) { 332
case 1: 336
if ((enemy1.y & hamper.y - 50) && (enemy1.y & hamper.y + 10) && 337
((enemy1.x + 50 == hamper.x) || (enemy1.x + 49 == hamper.x) || (enemy1.x + 48 == hamper.x) || (enemy1.x + 47 == hamper.x))) { 338
case 2: 342
if ((enemy1.x & hamper.x - 50) && (enemy1.x & hamper.x + 17) && 343
((enemy1.y + 50 == hamper.y) || (enemy1.y + 49 == hamper.y) || (enemy1.y + 48 == hamper.y) || (enemy1.y + 47 == hamper.y))) { 344
case 3: 348
if ((enemy1.y & hamper.y - 50) && (enemy1.y & hamper.y + 10) && 349
((enemy1.x == hamper.x + 17) || (enemy1.x == hamper.x + 16) || (enemy1.x == hamper.x + 15) || (enemy1.x == hamper.x + 14))) { 350
case 3: 356 357
case 4: 358 359
367 ///子弹类 368 function Bullet(x, y, speed, direct) 369 { 370
this.x = 371
this.y = 372
this.speed = 373
this.direct = 374
this.time = 375
this.islive = 376
this.run = function run(whotank) 377
//$("#tx").html(heroBullets[0].x); 379
//$("#ty").html(heroBullets[0].y); 380
if ((this.x &= 600 || this.x &= 0 || this.y &= 500 || this.y &= 0) && this.islive) { 382
window.clearInterval(this.time); 383
this.islive = 384
if (whotank == "h") { 385
hero1bullet = 386
switch (this.direct) { 387
case 0: 388
hero1bulletBomb = new bulletBomb(this.x - 68, this.y - 50); 389 390
case 1: 391
hero1bulletBomb = new bulletBomb(this.x - 68, this.y - 54); 392 393
case 2: 394
hero1bulletBomb = new bulletBomb(this.x - 68, this.y - 54); 395 396
case 3: 397
hero1bulletBomb = new bulletBomb(this.x - 68, this.y - 52); 398 399
//alert("00"); 401
else { 403
enemyBullets[whotank] = 404
switch (this.direct) 405
case 0: 407
enemyBulletBombs[whotank] = new bulletBomb(this.x - 68, this.y - 50); 408 409
case 1: 410
enemyBulletBombs[whotank] = new bulletBomb(this.x - 68, this.y - 54); 411 412
case 2: 413
enemyBulletBombs[whotank] = new bulletBomb(this.x - 68, this.y - 54); 414 415
case 3: 416
enemyBulletBombs[whotank] = new bulletBomb(this.x - 68, this.y - 52); 417 418
else { 424
switch (this.direct) { 425
case 0: 426
this.y = this.y - this. 427 428
case 1: 429
this.x = this.x + this. 430 431
case 2: 432
this.y = this.y + this. 433 434
case 3: 435
this.x = this.x - this. 436 437
} 441 } 442
443 ////画坦克函数 444 function DrawTank(tank) 445 { 446
switch (tank.direct) 447
case 0: 449
case 2: 450
///画玩家坦克,坦克尺寸为50*50 451
cxt.beginPath(); 452
cxt.fillStyle = tank.tankcolor[0]; 453
cxt.fillRect(tank.x, tank.y, 11, 50);
//画玩家坦克轮子 454
cxt.fillRect(tank.x + 12, tank.y + 10, 26, 30);
//中间部分 455
cxt.fillRect(tank.x + 39, tank.y, 11, 50);
//画玩家坦克轮子 456
///画坦克盖子 457
cxt.fillStyle = tank.tankcolor[1]; 458
cxt.arc(tank.x + 25, tank.y + 25, 10, 360, 0, true); 459
cxt.fill(); 460
cxt.closePath(); 461
////画炮口(炮口2px) 462
cxt.beginPath();
//开始一条新的路径,或重置当前的路径。 463
cxt.strokeStyle = tank.tankcolor[1];
//线条的颜色 464
cxt.lineWidth = 2;
//线条的宽度(炮口2px) 465
cxt.moveTo(tank.x + 25, tank.y + 25);
//炮口开始位置 466
if (tank.direct == 0) { 467
cxt.lineTo(tank.x + 25, tank.y + 0);
//炮口结束位置 468
else if (tank.direct == 2) { 470
cxt.lineTo(tank.x + 25, tank.y + 50);
//炮口结束位置 471
cxt.closePath();
//创建从当前点到开始点的路径。 474
cxt.stroke();
//画线 475 476
case 1: 477
case 3: 478
///画玩家坦克,坦克尺寸为50*50 479
cxt.beginPath(); 480
cxt.fillStyle = tank.tankcolor[0]; 481
cxt.fillRect(tank.x, tank.y, 50, 11);
//画玩家坦克轮子 482
cxt.fillRect(tank.x + 10, tank.y + 12, 30, 26);
//中间部分 483
cxt.fillRect(tank.x, tank.y + 39, 50, 11);
//画玩家坦克轮子 484
///画坦克盖子 485
cxt.fillStyle = tank.tankcolor[1]; 486
cxt.arc(tank.x + 25, tank.y + 25, 10, 360, 0, true); 487
cxt.fill(); 488
cxt.closePath(); 489
////画炮口(炮口2px) 490
cxt.beginPath();
//开始一条新的路径,或重置当前的路径。 491
cxt.strokeStyle = tank.tankcolor[1];
//线条的颜色 492
cxt.lineWidth = 2;
//线条的宽度(炮口2px) 493
cxt.moveTo(tank.x + 25, tank.y + 25);
//炮口开始位置 494
if (tank.direct == 1) { 495
cxt.lineTo(tank.x + 50, tank.y + 25);
//炮口结束位置 496
else if (tank.direct == 3) { 498
cxt.lineTo(tank.x, tank.y + 25);
//炮口结束位置 499
cxt.closePath();
//创建从当前点到开始点的路径。 501
cxt.stroke();
//画线 502 503
} 504 } 505 ///画出阻碍物(地图)、(style有4个值,1表示砖头、2表示钢铁、3表示草地、4表示河流) 506 function Hamper(x, y, style) 507 { 508
this.x = 509
this.y = 510
this.style = 511
//this.islive = 512
this.Draw = function () 513
switch (this.style) 515
case 1: 517
cxt.fillStyle = "#bc5018"; 518
cxt.fillRect(this.x, this.y, 17, 10); 519 520
case 2: 521
cxt.fillStyle = "#ffffff"; 522
cxt.fillRect(this.x, this.y, 17, 17); 523 524
case 3: 525 526
case 4: 527 528
} 530 } 531
532 ///画出子弹 533 function DrawBullet() 534 { 535
var enemyBullet = 536
cxt.fillStyle = "#ba9658"; 537
for (var en = 0; en & enemyBullets. en++) { 538
enemyBullet = enemyBullets[en]; 539
if (enemyBullet != null && enemyBullet.islive) { 540
switch (enemyBullet.direct) { 541
case 0: 542
case 2: 543
cxt.fillRect(enemyBullet.x, enemyBullet.y, 2, 3); 544 545
case 1: 546
case 3: 547
cxt.fillRect(enemyBullet.x, enemyBullet.y, 3, 2); 548 549
if (hero1bullet != null && hero1bullet.islive) { 553
switch (hero1bullet.direct) { 554
case 0: 555
case 2: 556
cxt.fillRect(hero1bullet.x, hero1bullet.y, 2, 3); 557 558
case 1: 559
case 3: 560
cxt.fillRect(hero1bullet.x, hero1bullet.y, 3, 2); 561 562
567 ////画出基地 568 function DrawSymbol() 569 { 570
cxt.beginPath(); 571
if (gameover) { 572
cxt.drawImage(base2, 280, 450, 50, 50); 573
else { 575
cxt.drawImage(base1, 280, 450, 50, 50); 576
cxt.closePath(); 578 } 579
580 ////判断子弹是否打中坦克 581 function hitTank() 582 { 583
////敌人子弹是否打中玩家坦克 584
for (var eb = 0; eb & enemyBullets. eb++) 585
if (hero1 != null && hero1.islive != 0 && enemyBullets[eb] != null) { 587
switch (enemyBullets[eb].direct) { 588
case 0: 589
if ((enemyBullets[eb].x + 2 &= hero1.x) && (enemyBullets[eb].x + 2 &= hero1.x + 50) && (enemyBullets[eb].y + 3 &= hero1.y + 50) && (enemyBullets[eb].y + 3 &= hero1.y)) { 590
enemyBullets[eb].islive = 591
window.clearInterval(enemyBullets[eb].time); 592
enemyBullets[eb] = 593
hero1.islive--; 594
case 1: 597
if ((enemyBullets[eb].x + 3 &= hero1.x) && (enemyBullets[eb].x + 3 &= hero1.x + 50) && (enemyBullets[eb].y + 2 &= hero1.y) && (enemyBullets[eb].y + 2 &= hero1.y + 50)) { 598
enemyBullets[eb].islive = 599
window.clearInterval(enemyBullets[eb].time); 600
enemyBullets[eb] = 601
hero1.islive--; 602
case 2: 605
if ((enemyBullets[eb].x + 2 &= hero1.x) && (enemyBullets[eb].x + 2 &= hero1.x + 50) && (enemyBullets[eb].y + 3 &= hero1.y + 50) && (enemyBullets[eb].y + 3 &= hero1.y)) { 606
enemyBullets[eb].islive = 607
window.clearInterval(enemyBullets[eb].time); 608
enemyBullets[eb] = 609
hero1.islive--; 610
case 3: 613
if ((enemyBullets[eb].x &= hero1.x + 50) && (enemyBullets[eb].x &= hero1.x) && (enemyBullets[eb].y + 2 &= hero1.y) && (enemyBullets[eb].y + 2 &= hero1.y + 50)) { 614
enemyBullets[eb].islive = 615
window.clearInterval(enemyBullets[eb].time); 616
enemyBullets[eb] = 617
hero1.islive--; 618
if (hero1.islive == 0) { 622
var tankbomb = new TankBomb(hero1.x, hero1.y); 623
tankbombs.push(tankbomb); 624
hero1 = 625
if (hero1 == null) { 626
gameover = 627
////敌人子弹是否打中阻碍物 632
var enemybullet = 633
var hamper = 634
for (var eb = 0; eb & enemyBullets. eb++) 635
enemybullet = enemyBullets[eb]; 637
if (enemybullet != null) 638
for (var ha = 0; ha & hampers. ha++) { 640
hamper = hampers[ha]; 641
if (hamper != null && enemybullet != null) { 642
switch (enemybullet.direct) { 643
case 0: 644
switch (hamper.style) { 645
case 1: 646
if ((enemybullet.x &= hamper.x - 1) && (enemybullet.x &= hamper.x + 17) && 647
(enemybullet.y &= hamper.y + 10) && (enemybullet.y &= hamper.y)) { 648
enemyBullets[eb].islive = 649
window.clearInterval(enemyBullets[eb].time); 650
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 651
enemyBullets[eb] = 652
hampers[ha] = 653
case 2: 656
if ((enemybullet.x &= hamper.x - 1) && (enemybullet.x &= hamper.x + 17) && 657
(enemybullet.y &= hamper.y + 20) && (enemybullet.y &= hamper.y)) { 658
enemyBullets[eb].islive = 659
window.clearInterval(enemyBullets[eb].time); 660
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 661
enemyBullets[eb] = 662
case 1: 669
switch (hamper.style) { 670
case 1: 671
if ((enemybullet.x &= hamper.x) && (enemybullet.x &= hamper.x + 17) && 672
(enemybullet.y &= hamper.y + 10) && (enemybullet.y &= hamper.y - 1)) { 673
enemyBullets[eb].islive = 674
window.clearInterval(enemyBullets[eb].time); 675
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 676
enemyBullets[eb] = 677
hampers[ha] = 678
case 2: 681
if ((enemybullet.x &= hamper.x) && (enemybullet.x &= hamper.x + 17) && 682
(enemybullet.y &= hamper.y + 17) && (enemybullet.y &= hamper.y - 1)) { 683
enemyBullets[eb].islive = 684
window.clearInterval(enemyBullets[eb].time); 685
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 686
enemyBullets[eb] = 687
case 2: 693
switch (hamper.style) { 694
case 1: 695
if ((enemybullet.x &= hamper.x - 1) && (enemybullet.x &= hamper.x + 17) && 696
(enemybullet.y + 2 &= hamper.y + 10) && (enemybullet.y + 2 &= hamper.y)) { 697
enemyBullets[eb].islive = 698
window.clearInterval(enemyBullets[eb].time); 699
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 700
enemyBullets[eb] = 701
hampers[ha] = 702
case 2: 705
if ((enemybullet.x &= hamper.x - 1) && (enemybullet.x &= hamper.x + 17) && 706
(enemybullet.y + 2 &= hamper.y + 17) && (enemybullet.y + 2 &= hamper.y)) { 707
enemyBullets[eb].islive = 708
window.clearInterval(enemyBullets[eb].time); 709
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 710
enemyBullets[eb] = 711
case 3: 716
switch (hamper.style) { 717
case 1: 718
if ((enemybullet.x &= hamper.x) && (enemybullet.x &= hamper.x + 17) && 719
(enemybullet.y + 1 &= hamper.y + 10) && (enemybullet.y + 1 &= hamper.y)) { 720
enemyBullets[eb].islive = 721
window.clearInterval(enemyBullets[eb].time); 722
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 723
enemyBullets[eb] = 724
hampers[ha] = 725
case 2: 728
if ((enemybullet.x &= hamper.x) && (enemybullet.x &= hamper.x + 17) && 729
(enemybullet.y + 1 &= hamper.y + 20) && (enemybullet.y + 1 &= hamper.y)) { 730
enemyBullets[eb].islive = 731
window.clearInterval(enemyBullets[eb].time); 732
enemyBulletBombs[eb] = new bulletBomb(enemybullet.x - 68, enemybullet.y - 50); 733
enemyBullets[eb] = 734
////玩家子弹是否打中敌人坦克 746
////是否打中阻碍物 747
if (hero1bullet != null) 748
for (var en = 0; en & enemys. en++) { 750
if (enemys[en] != null && enemys[en].islive != 0 && hero1bullet != null) { 751
switch (hero1bullet.direct) { 752
case 0: 753
if ((hero1bullet.x + 2 &= enemys[en].x) && (hero1bullet.x + 2 &= enemys[en].x + 50) && (hero1bullet.y + 3 &= enemys[en].y + 50) && (hero1bullet.y + 3 &= enemys[en].y)) { 754
hero1bullet.islive = 755
window.clearInterval(hero1bullet.time); 756
hero1bullet = 757
enemys[en].islive--; 758
case 1: 761
if ((hero1bullet.x + 3 &= enemys[en].x) && (hero1bullet.x + 3 &= enemys[en].x + 50) && (hero1bullet.y + 2 &= enemys[en].y) && (hero1bullet.y + 2 &= enemys[en].y + 50)) { 762
hero1bullet.islive = 763
window.clearInterval(hero1bullet.time); 764
hero1bullet = 765
enemys[en].islive--; 766
case 2: 769
if ((hero1bullet.x + 2 &= enemys[en].x) && (hero1bullet.x + 2 &= enemys[en].x + 50) && (hero1bullet.y + 3 &= enemys[en].y + 50) && (hero1bullet.y + 3 &= enemys[en].y)) { 770
hero1bullet.islive = 771
window.clearInterval(hero1bullet.time); 772
hero1bullet = 773
enemys[en].islive--; 774
case 3: 777
if ((hero1bullet.x &= enemys[en].x + 50) && (hero1bullet.x &= enemys[en].x) && (hero1bullet.y + 2 &= enemys[en].y) && (hero1bullet.y + 2 &= enemys[en].y + 50)) { 778
hero1bullet.islive = 779
window.clearInterval(hero1bullet.time); 780
hero1bullet = 781
enemys[en].islive--; 782
if (enemys[en].islive == 0) { 786
var tankbomb = new TankBomb(enemys[en].x, enemys[en].y); 787
tankbombs.push(tankbomb); 788
enemys[en] = 789
var hamper = 793
for (var ha = 0; ha & hampers. ha++) 794
hamper = hampers[ha]; 796
if (hamper != null && hero1bullet!=null) 797
switch (hero1bullet.direct) { 799
case 0: 800
switch (hamper.style) 801
case 1: 803
if ((hero1bullet.x &= hamper.x - 1) && (hero1bullet.x &= hamper.x + 17) && 804
(hero1bullet.y &= hamper.y + 10) && (hero1bullet.y &= hamper.y)) { 805
hero1bullet.islive = 806
window.clearInterval(hero1bullet.time); 807
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 808
hero1bullet = 809
hampers[ha] = 810
case 2: 813
if ((hero1bullet.x &= hamper.x - 1) && (hero1bullet.x &= hamper.x + 17) && 814
(hero1bullet.y &= hamper.y + 20) && (hero1bullet.y &= hamper.y)) { 815
hero1bullet.islive = 816
window.clearInterval(hero1bullet.time); 817
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 818
hero1bullet = 819
case 1: 826
switch (hamper.style) { 827
case 1: 828
if ((hero1bullet.x &= hamper.x) && (hero1bullet.x &= hamper.x + 17) && 829
(hero1bullet.y &= hamper.y + 10) && (hero1bullet.y &= hamper.y-1)) { 830
hero1bullet.islive = 831
window.clearInterval(hero1bullet.time); 832
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 833
hero1bullet = 834
hampers[ha] = 835
case 2: 838
if ((hero1bullet.x &= hamper.x) && (hero1bullet.x &= hamper.x + 17) && 839
(hero1bullet.y &= hamper.y + 17) && (hero1bullet.y &= hamper.y-1)) { 840
hero1bullet.islive = 841
window.clearInterval(hero1bullet.time); 842
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 843
hero1bullet = 844
case 2: 850
switch (hamper.style) { 851
case 1: 852
if ((hero1bullet.x &= hamper.x - 1) && (hero1bullet.x &= hamper.x + 17) && 853
(hero1bullet.y + 2 &= hamper.y + 10) && (hero1bullet.y + 2 &= hamper.y)) { 854
hero1bullet.islive = 855
window.clearInterval(hero1bullet.time); 856
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 857
hero1bullet = 858
hampers[ha] = 859
case 2: 862
if ((hero1bullet.x &= hamper.x - 1) && (hero1bullet.x &= hamper.x + 17) && 863
(hero1bullet.y+2 &= hamper.y + 17) && (hero1bullet.y+2 &= hamper.y)) { 864
hero1bullet.islive = 865
window.clearInterval(hero1bullet.time); 866
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 867
hero1bullet = 868
case 3: 873
switch (hamper.style) { 874
case 1: 875
if ((hero1bullet.x &= hamper.x) && (hero1bullet.x &= hamper.x + 17) && 876
(hero1bullet.y+1 &= hamper.y + 10) && (hero1bullet.y+1 &= hamper.y)) { 877
hero1bullet.islive = 878
window.clearInterval(hero1bullet.time); 879
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 880
hero1bullet = 881
hampers[ha] = 882
case 2: 885
if ((hero1bullet.x &= hamper.x) && (hero1bullet.x &= hamper.x + 17) && 886
(hero1bullet.y+1 &= hamper.y + 20) && (hero1bullet.y+1 &= hamper.y)) { 887
hero1bullet.islive = 888
window.clearInterval(hero1bullet.time); 889
hero1bulletBomb = new bulletBomb(hero1bullet.x - 68, hero1bullet.y - 50); 890
hero1bullet = 891
} 901 } 902
903 ///坦克爆炸类 904 function TankBomb(x, y) { 905
this.x = 906
this.y = 907
this.time = 0; 908
this.imgsrc = ""; 909
this.isLive = 910
this.drawBomb = function drawBomb() { 913
if (this.time &= 2) { 914
cxt.drawImage(bomb3, this.x, this.y, 50, 50); 915
if (this.time & 2 && this.time &= 5) { 917
cxt.drawImage(bomb2, this.x, this.y, 50, 50); 918
if (this.time &= 6 && this.time &= 9) { 920
cxt.drawImage(bomb1, this.x, this.y, 50, 50); 921
if (this.time &= 10 && this.time &= 12) 923
cxt.drawImage(bomb2, this.x, this.y, 50, 50); 925
if (this.time &= 13 && this.time &= 15) 927
cxt.drawImage(bomb3, this.x, this.y, 50, 50); 929
this.time++; 931
if (this.time &= 15) { 932
this.isLive = 933
this.time = 0; 934
}; 936 } 937 ///子弹爆炸类 938 function bulletBomb(x, y) 939 { 940
this.x = 941
this.y = 942
this.drawBomb = function () 944
cxt.drawImage(buBoImg, this.x, this.y); 946
} 948 } 949 ///判断基地是否被打中 950 function hitBase() { 951
if (gameover) { 952 953
var enemybullet = 955
for (var en = 0; en & enemyBullets. en++) { 956
enemybullet = enemyBullets[en]; 957
if (enemybullet != null) { 958
switch (enemybullet.direct) { 959
case 0: 960 961
case 1: 962
if ((enemybullet.x &= 280) && (enemybullet.x &= 330) && 963
(enemybullet.y + 1 &= 450) && (enemybullet.y &= 500)) { 964
gameover = 965
enemyBullets[en] = 966
case 2: 969
if ((enemybullet.x + 1 &= 280) && (enemybullet.x &= 330) && 970
(enemybullet.y + 2 &= 450) && (enemybullet.y + 2 &= 500)) { 971
gameover = 972
enemyBullets[en] = 973
case 3: 976
if ((enemybullet.x &= 280) && (enemybullet.x &= 330) && 977
(enemybullet.y + 1 &= 450) && (enemybullet.y &= 500)) { 978
gameover = 979
enemyBullets[en] = 980
if (hero1bullet != null) { 986
switch (hero1bullet.direct) { 987
case 0: 988 989
case 1: 990
if ((hero1bullet.x &= 280) && (hero1bullet.x &= 330) && 991
(hero1bullet.y + 1 &= 450) && (hero1bullet.y &= 500)) { 992
gameover = 993
window.clearInterval(hero1bullet.time); 994
hero1bullet = 995
case 2: 998
if ((hero1bullet.x + 1 &= 280) && (hero1bullet.x &= 330) && 999
(hero1bullet.y + 2 &= 450) && (hero1bullet.y + 2 &= 500)) {1000
gameover =1001
window.clearInterval(hero1bullet.time);1002
hero1bullet =1003
case 3:1006
if ((hero1bullet.x &= 280) && (hero1bullet.x &= 330) &&1007
(hero1bullet.y + 1 &= 450) && (hero1bullet.y &= 500)) {1008
gameover =1009
window.clearInterval(hero1bullet.time);1010
hero1bullet =1011
} 1017 ///画出GAMEOVER1018 var gameY = 500;1019 function GameOver()
if (gameY & 193) {1022
gameY = gameY - 4;1023
if (verygood)1025
cxt.beginPath();1027
cxt.fillStyle = "#CCCCCC";1028
cxt.fillRect(190, gameY, 215, 115)1029
cxt.closePath();1030
cxt.beginPath();1031
cxt.fillStyle = "#ff
cxt.font = "35px Engravers MT";1033
cxt.fillText("V E R Y", 212, gameY + 57);1034
cxt.fillText("G O O D", 212, gameY + 90);1035
cxt.closePath();
if (gameover)1039
cxt.beginPath();1041
cxt.fillStyle = "#CCCCCC";1042
cxt.fillRect(190, gameY, 215, 115)1043
cxt.closePath();1044
cxt.beginPath();1045
cxt.fillStyle = "#ff
cxt.font = "35px Engravers MT";1047
cxt.fillText("G A M E", 212, gameY + 57);1048
cxt.fillText("O V E R", 212, gameY + 90);1049
cxt.closePath();1050
1052 }Draw.js 1 ////阻碍物 Hamper类参数:x,y,style 2 var hampers = new Array(); 3 ///画出保存基地的墙(一个20块砖头) 4 var basehamX = 260; 5 var basehamY = 490; 6 for (var ham = 0; ham & 20; ham++) { 7
if (ham & 7) { 8
hampers[ham] = new Hamper(basehamX, basehamY - ham * 11, 1); 9
if (ham &= 7 && ham & 10) { 11
hampers[ham] = new Hamper(basehamX + (ham - 6) * 18, basehamY - 5 * 11, 1); 12
if (ham &= 10 && ham & 13) { 14
hampers[ham] = new Hamper(basehamX + (ham - 9) * 18, basehamY - 6 * 11, 1); 15
if (ham &= 13) { 17
hampers[ham] = new Hamper(basehamX + 4 * 18, basehamY - (ham - 13) * 11, 1) 18
} 19 } 20 $.getScript("script/js/map1.js"); 21
22 ///定义玩家1坦克 23 var hero1born = new Born(180, 450); 24 var hero1 = 25
26 //敌人坦克出生数组 27 var enemyborns = new Array(); 28
29 enemyborns[0] = new Born(0, 0); 30 enemyborns[1] = new Born(275, 0); 31 enemyborns[2] = new Born(550, 0); 32
33 ///定义敌人数组 34 var enemys = new Array(); 35
36 ///判断屏幕是否有5个敌人坦克,如果少于5个,则生产一个 37 var enemy_loca = 1; 38 function enemyBorn() { 39
var enemynum = 0; 40
for (var en = 0; en & enemys. en++) { 41
if (enemys[en] != null) { 42
enemynum++; 43
if (enemynum & 5 && enemys.length & 20) { 46
var enemyborn = 47
switch (enemy_loca) { 48
case 1: 49
enemyborn = new Born(0, 0); 50
enemy_loca = 2; 51 52
case 2: 53
enemyborn = new Born(275, 0); 54
enemy_loca = 3; 55 56
case 3: 57
enemyborn = new Born(550, 0); 58
enemy_loca = 1; 59 60
default: 61
enemyborn = new Born(0, 0); 62 63
enemyborns.push(enemyborn); 66
if (enemynum &= 0 && enemys.length &= 20) { 68
verygood = 69
71 } 72 window.setInterval("enemyBorn()", 3000); 73
74 ////爆炸 75 var tankbombs = new Array(); 76
77 ///敌人坦克移动 78 function moveEnemyTank() { 79
for (var e = 0; e & enemys. e++) { 80
if (enemys[e] != null && enemys[e].islive != 0) { 81
enemys[e].run(); 82
enemys[e].attackEnemy(e); 83
} 85 } 86 window.setInterval("moveEnemyTank()", 100); 87
88 function flashTankMap() { 89
cxt.clearRect(0, 0, 600, 500); 90
///画出阻碍物 91
for (var ha = 0; ha & hampers. ha++) { 92
if (hampers[ha] != null) { 93
hampers[ha].Draw(); 94
//画出玩家坦克 99
if (hero1born != null) {100
if (hero1born.born) {101
hero1born.drawBorn();102
hero1 = new Hero(hero1born.x, hero1born.y, 2, 0, heroColor1, 4);105
hero1born =106
if (hero1 != null && hero1.islive != 0) {109
DrawTank(hero1);110
///画出子弹112
DrawBullet();113
///判断子弹是否打中坦克114
///画出敌人坦克115
for (var bo = 0; bo & enemyborns. bo++) {116
if (enemyborns[bo] != null) {117
if (enemyborns[bo].born) {118
enemyborns[bo].drawBorn();119
var enemy =122
switch (Math.round(Math.random() * 3)) {123
case 0:124
enemy = new Enemy(enemyborns[bo].x, enemyborns[bo].y, 3, 2, enemyColor1, 1);125126
case 1:127
enemy = new Enemy(enemyborns[bo].x, enemyborns[bo].y, 3, 2, enemyColor2, 1);128129
case 2:130
enemy = new Enemy(enemyborns[bo].x, enemyborns[bo].y, 3, 2, enemyColor3, 1);131132
case 3:133
enemy = new Enemy(enemyborns[bo].x, enemyborns[bo].y, 3, 2, enemyColor4, 1);134135
if (enemy != null) {137
enemys.push(enemy);138
enemyborns[bo] =140
for (var e = 0; e & enemys. e++) {144
if (enemys[e] != null && enemys[e].islive != 0) {145
DrawTank(enemys[e]);146
///画出爆炸效果149
for (var bo = 0; bo & tankbombs. bo++) {150
if (tankbombs[bo].isLive) {151
tankbombs[bo].drawBomb();152
////子弹爆炸155
for (var bubo = 0; bubo & enemyBulletBombs. bubo++) {156
if (enemyBulletBombs[bubo] != null) {157
enemyBulletBombs[bubo].drawBomb();158
enemyBulletBombs[bubo] =160
if (hero1bulletBomb != null) {162
hero1bulletBomb.drawBomb();163
hero1bulletBomb =164
///画出基地166
DrawSymbol();167
///调用判断基地是否被打中的函数168
hitBase();169
GameOver();171 }172 flashTankMap();173 174 ///判断按键175 var lastcode = 87;176 function getCommand() {177
if (hero1 == null || hero1.islive == 0 || gameover) {178179
var keycode = event.keyC181
switch (keycode) {182
case 87:///上183
if (lastcode == 87) {184
if (!heroTankCollision()) {185
hero1.moveUp();186
lastcode = 87;190
hero1.direct = 0;191
case 68:///右194
if (lastcode == 68) {195
if (!heroTankCollision()) {196
hero1.moveRight();197
lastcode = 68;201
hero1.direct = 1;202
case 83:////下205
if (lastcode == 83) {206
if (!heroTankCollision()) {207
hero1.moveDown();208
lastcode = 83;212
hero1.direct = 2;213
case 65:///左216
if (lastcode == 65) {217
if (!heroTankCollision()) {218
hero1.moveLeft();219
lastcode = 65;223
hero1.direct = 3;224
case 74:////开炮227
//hero1.tankbullet = "1";228
hero1.attackEnemy();229230
case 66:231232
default:233234
flashTankMap();236 }237 window.setInterval("flashTankMap()", 100);238 window.setInterval("hitTank()", 20);239 //玩家坦克与敌人坦克、阻碍物之间的碰撞240 function heroTankCollision() {241
//玩家坦克与敌人坦克之间的碰撞242
var enemy =243
for (var en = 0; en & enemys. en++) {244
enemy = enemys[en];245
if (enemy != null && enemy.islive != 0) {246
switch (hero1.direct) {247
case 0:248
if ((hero1.x & enemy.x - 50) && (hero1.x & enemy.x + 50) &&249
((hero1.y == enemy.y + 47) || (hero1.y == enemy.y + 48) || (hero1.y == enemy.y + 49) || (hero1.y == enemy.y + 50))) {250
//else {253
case 1:257
if ((hero1.y & enemy.y - 50) && (hero1.y & enemy.y + 50) &&258
((hero1.x + 47 == enemy.x) || (hero1.x + 50 == enemy.x) || (hero1.x + 49 == enemy.x) || (hero1.x + 48 == enemy.x))) {259
}261 262263
case 2:264
if ((hero1.x & enemy.x - 50) && (hero1.x & enemy.x + 50) &&265
((hero1.y + 47 == enemy.y) || (hero1.y + 50 == enemy.y) || (hero1.y + 49 == enemy.y) || (hero1.y + 48 == enemy.y))) {266
}268 269270
case 3:271
if ((hero1.y & enemy.y - 50) && (hero1.y & enemy.y + 50) &&272
((hero1.x == enemy.x + 47) || (hero1.x == enemy.x + 50) || (hero1.x == enemy.x + 49) || (hero1.x == enemy.x + 48))) {273
}275 276277
//玩家坦克与阻碍物之间的碰撞281
var hamper =282
for (var ha = 0; ha & hampers. ha++) {283
hamper = hampers[ha];284
if (hamper != null) {285
switch (hampers[ha].style) {286
case 1:287
switch (hero1.direct) {288
case 0:289
if ((hero1.x & hamper.x - 50) && (hero1.x & hamper.x + 17) &&290
((hero1.y == hamper.y + 7) || (hero1.y == hamper.y + 8) || (hero1.y == hamper.y + 9) || (hero1.y == hamper.y + 10))) {291
case 1:295
if ((hero1.y & hamper.y - 50) && (hero1.y & hamper.y + 10) &&296
((hero1.x + 50 == hamper.x) || (hero1.x + 49 == hamper.x) || (hero1.x + 48 == hamper.x) || (hero1.x + 47 == hamper.x))) {297
case 2:301
if ((hero1.x & hamper.x - 50) && (hero1.x & hamper.x + 17) &&302
((hero1.y + 50 == hamper.y) || (hero1.y + 49 == hamper.y) || (hero1.y + 48 == hamper.y) || (hero1.y + 47 == hamper.y))) {303
case 3:307
if ((hero1.y & hamper.y - 50) && (hero1.y & hamper.y + 10) &&308
((hero1.x == hamper.x + 17) || (hero1.x == hamper.x + 16) || (hero1.x == hamper.x + 15) || (hero1.x == hamper.x + 14))) {309
case 2:315
switch (hero1.direct) {316
case 0:317
if ((hero1.x &= hamper.x - 50) && (hero1.x &= hamper.x + 17) &&318
((hero1.y == hamper.y + 14) || (hero1.y == hamper.y + 15) || (hero1.y == hamper.y + 16) || (hero1.y == hamper.y + 17))) {319
case 1:323
if ((hero1.y & hamper.y - 50) && (hero1.y & hamper.y + 10) &&324
((hero1.x + 50 == hamper.x) || (hero1.x + 49 == hamper.x) || (hero1.x + 48 == hamper.x) || (hero1.x + 47 == hamper.x))) {325
case 2:329
if ((hero1.x & hamper.x - 50) && (hero1.x & hamper.x + 17) &&330
((hero1.y + 50 == hamper.y) || (hero1.y + 49 == hamper.y) || (hero1.y + 48 == hamper.y) || (hero1.y + 47 == hamper.y))) {331
case 3:335
if ((hero1.y & hamper.y - 50) && (hero1.y & hamper.y + 10) &&336
((hero1.x == hamper.x + 17) || (hero1.x == hamper.x + 16) || (hero1.x == hamper.x + 15) || (hero1.x == hamper.x + 14))) {337
case 3:343344
case 4:345346
}349 350 }opera_js.js  还有地图&&  需要代码的可以联系我,我的邮箱是:
[页设计]《HTML5经典坦克大战》游戏(代码)_郑少群个人前几天粗略地学了HTML5,然后就用它写了一个《经典坦克大战》游戏。 现在想分享一下我写的代码,写得不好请大家多多指教。 游戏站:...精品素材:扁平风格苹果设备原型素材【免费下载】_HTML5-手机开发...下一篇:HTML的标题样式上一篇:《HTML5经典坦克大战》游戏(代码)相关分类 Android HTML5 iOS JAVA Windows Phone下级分类 html5书籍 ...

我要回帖

更多关于 小米2a怎么样 的文章

 

随机推荐