当前位置: 首页 > news >正文

洛阳做网站哪家专业国外b站视频推广网站

洛阳做网站哪家专业,国外b站视频推广网站,深圳公司网站如何设计,工程建设云个人服务平台欢迎来到程序小院 掉落的俄罗斯方块 玩法&#xff1a;上键 W↑变换、 左键 A← 左移、右键 D→ 右移、下键S ↓ 加速,两种模式&#xff0c; 可以一个大人玩&#xff0c;也可以两个人一起玩&#xff0c;小鸟经过会撞走方块&#xff0c;快去体验吧^^。开始游戏 html <div idc…

欢迎来到程序小院

掉落的俄罗斯方块

玩法:上键 W↑变换、 左键 A← 左移、右键 D→ 右移、下键S ↓ 加速,两种模式,
可以一个大人玩,也可以两个人一起玩,小鸟经过会撞走方块,快去体验吧^^。

开始游戏

html

  <div id='container'></div>

css

canvas{display: block;touch-action: none;user-select: none;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); width: 800px; height: 500px; cursor: inherit; margin-left: 97px; margin-right: -97px
}

js

function playState(){var layer;var player,bird;var iBox,lBox,oBox,tBox,xBox;var overGroup,gameOver=false;var point,playerPoint=0;var gameOverText;var keys;var xNumber,yNumber;this.init = function(){//获取当前可用分辨率if(!isPc){game.width = Math.floor(window.innerWidth/16)*16;game.height = Math.floor(window.innerHeight/16)*16;}}this.create = function () {game.physics.startSystem(Phaser.Physics.P2JS);game.physics.p2.gravity.y=150;//添加瓦片地图if(isPc){var map = game.add.tilemap('map_1');map.addTilesetImage('mario','mario');layer = map.createLayer('bg');layer.resizeWorld();//设置世界大小等于图层大小map.setCollision(40);}else{xNumber = width/16;yNumber = height/16;var map = game.add.tilemap();map.addTilesetImage('mario','mario',16,16);layer = map.create('layer',xNumber,yNumber,16,16);map.fill(0,0,0,xNumber,yNumber,layer);map.replace(0,39,Math.floor(xNumber/4),yNumber-Math.floor(yNumber/3),Math.floor(xNumber/2),Math.floor(yNumber/3)-1,layer)layer.resizeWorld();//设置世界大小等于图层大小map.setCollision(39);}game.physics.p2.convertTilemap(map, layer);//鸟bird = game.add.sprite(20,200,'bird');bird.anchor.setTo(0.5);game.physics.p2.enable(bird,false);bird.body.kinematic = true;bird.animations.add('fly',[1,2,3]);bird.animations.play('fly',12,true);bird.body.angle = 10;game.add.tween(bird.body).to({y:180,angle:-10},450,null,true,0,Number.MAX_VALUE,true);//随机产生boxfunction createBox(){var random = Math.floor(Math.random()*7);switch (random){case 0:player = game.add.sprite(width/2,50,'iBox');game.physics.p2.enable(player,false);break;case 1:player = game.add.sprite(width/2,50,'lBox');game.physics.p2.enable(player,false);player.body.clearShapes();player.body.loadPolygon('physicsData','LBox');break;case 2:player = game.add.sprite(width/2,50,'oBox');game.physics.p2.enable(player,false);break;case 3:player = game.add.sprite(width/2,50,'tBox');game.physics.p2.enable(player,false);player.body.clearShapes();player.body.loadPolygon('physicsData','TBox');break;case 4:player = game.add.sprite(width/2,50,'xBox');game.physics.p2.enable(player,false);player.body.clearShapes();player.body.loadPolygon('physicsData','XBox');break;case 5:player = game.add.sprite(width/2,50,'xBox_');game.physics.p2.enable(player,false);player.body.clearShapes();player.body.loadPolygon('physicsData','XBox_');break;case 6:player = game.add.sprite(width/2,50,'lBox_');game.physics.p2.enable(player,false);player.body.clearShapes();player.body.loadPolygon('physicsData','LBox_');break;}player.body.damping=0.6;player.body.onBeginContact.addOnce(blockHit, this);}createBox();//碰撞檢測function blockHit(body, bodyB, shapeA, shapeB, equation){if(!gameOver){if(body){groundSound.play();if(body.sprite==null||body.sprite.key!='bird'){getPoint();createBox();}else{player.body.onBeginContact.removeAll();player.body.onBeginContact.addOnce(blockHit, this);}}}}//在底部添加碰撞的组.如果被碰撞游戏结束overGroup=game.add.group();overGroup.enableBody=true;overGroup.physicsBodyType=Phaser.Physics.P2JS;for (var i=0;i<width/16/2;i++){var over = overGroup.create(i*32+10,height-8,'down');over.body.kinematic = true;//保持固定over.body.onBeginContact.add(function(body, bodyB, shapeA, shapeB, equation){if(body){gameOver=true;game.input.onDown.add(function(){game.state.start('menu');gameOver=false;playerPoint = 0;gameOverText=null;});}},this);}//计分函数point = game.add.text(width-100,50,playerPoint);point.font = 'Arial Black';point.fontWeight = 'bold';point.fill = '#ec008c';point.fontSize = 50;point.setShadow(2, 2, 'rgba(0, 0, 0, 0.5)', 2);function getPoint(){playerPoint++;point.text=playerPoint;}//添加触屏按钮if(!isPc){var btn_change = game.add.button(width-150,height/3*2,'change',actionOnClick,this);btn_change.scale.setTo(1.2);btn_change.alpha=0.3;var btn_left = game.add.button(0,height/3*2,'fxj',left_go,this);var btn_right = game.add.button(200,height/3*2,'fxj',right_go,this);var btn_up = game.add.button(100,height/3*2-100,'fxj',up_go,this);var btn_down = game.add.button(100,height/3*2+100,'fxj',down_go,this);btn_left.alpha = 0.3;btn_left.scale.setTo(1.2);btn_right.alpha = 0.3;btn_right.scale.setTo(1.2);btn_up.alpha = 0.3;btn_up.scale.setTo(1.2);btn_down.alpha = 0.3;btn_down.scale.setTo(1.2);function actionOnClick(){btnSound.play();player.body.angle = player.body.angle + 90;}function left_go(key){btnSound.play();player.body.velocity.x = -120;}function right_go(key){btnSound.play();player.body.velocity.x = 120;}function up_go(key){btnSound.play();player.body.velocity.y = 0;}function down_go(key){btnSound.play();player.body.velocity.y += 100;}}else{//按键keys = game.input.keyboard.addKeys({ left: Phaser.Keyboard.LEFT, right: Phaser.Keyboard.RIGHT, up: Phaser.Keyboard.UP,down:Phaser.Keyboard.DOWN,spin: Phaser.Keyboard.SPACEBAR });keys.left.onDown.add(keyDown,this);keys.right.onDown.add(keyDown,this);keys.up.onDown.add(keyDown,this);keys.spin.onDown.add(keyDown,this);keys.down.onDown.add(keyDown,this);function keyDown(key){if(!gameOver){switch (key.keyCode){case Phaser.Keyboard.LEFT:btnSound.play();player.body.velocity.x = -80;break;case Phaser.Keyboard.RIGHT:btnSound.play();player.body.velocity.x = 80;break;case Phaser.Keyboard.UP:btnSound.play();player.body.velocity.y = 0;break;case Phaser.Keyboard.DOWN:btnSound.play();player.body.velocity.y +=100;break;case Phaser.Keyboard.SPACEBAR:btnSound.play();player.body.angle = player.body.angle + 90;break;}}}}}this.update = function () {bird.body.x+=3;if(bird.body.x > width+20){bird.body.x = 0;}if(gameOver){createGameOverText();}}function createGameOverText(){if(gameOverText==null){if(player.body.y==50){playerPoint--;player.kill();point.text=playerPoint;}scoreSound.play();gameOverText = game.add.text(game.width/2,game.height/2,'游戏结束 !!\n得分:' + playerPoint+'\n点击屏幕重新开始');gameOverText.anchor.setTo(0.5);gameOverText.font = 'Arial Black';gameOverText.fontWeight = 'bold';gameOverText.fill = '#ec008c';gameOverText.fontSize=40;gameOverText.setShadow(5, 5, 'rgba(0, 0, 0, 0.5)', 5);}}
}

源码

需要源码请关注添加好友哦^ ^

转载:欢迎来到本站,转载请注明文章出处https://ormcc.com/


文章转载自:
http://dinncopseudosalt.tqpr.cn
http://dinncoparabombs.tqpr.cn
http://dinncogastroenteritis.tqpr.cn
http://dinncowarning.tqpr.cn
http://dinncocircumflect.tqpr.cn
http://dinncosepticemic.tqpr.cn
http://dinncocommuter.tqpr.cn
http://dinncotoxaemia.tqpr.cn
http://dinncopostamble.tqpr.cn
http://dinncoadenomatoid.tqpr.cn
http://dinncosequence.tqpr.cn
http://dinncogaudiness.tqpr.cn
http://dinncounsleeping.tqpr.cn
http://dinncorust.tqpr.cn
http://dinncofaradaic.tqpr.cn
http://dinncoscaraboid.tqpr.cn
http://dinncomethylamine.tqpr.cn
http://dinncoresponsibility.tqpr.cn
http://dinnconickelize.tqpr.cn
http://dinncocoffeepot.tqpr.cn
http://dinncoablator.tqpr.cn
http://dinncononcombat.tqpr.cn
http://dinncotroilite.tqpr.cn
http://dinncoclicketyclack.tqpr.cn
http://dinncoexport.tqpr.cn
http://dinncomusky.tqpr.cn
http://dinnconidicolous.tqpr.cn
http://dinncofacto.tqpr.cn
http://dinncotridactyl.tqpr.cn
http://dinncoseismography.tqpr.cn
http://dinncomoneybag.tqpr.cn
http://dinncobreakaway.tqpr.cn
http://dinncochukchi.tqpr.cn
http://dinncohowdy.tqpr.cn
http://dinncoashery.tqpr.cn
http://dinncomotorcoach.tqpr.cn
http://dinncotheistic.tqpr.cn
http://dinncobulldiker.tqpr.cn
http://dinncodeviant.tqpr.cn
http://dinncounderstudy.tqpr.cn
http://dinncochromaticity.tqpr.cn
http://dinncofeu.tqpr.cn
http://dinncowast.tqpr.cn
http://dinncoprotoplast.tqpr.cn
http://dinncosouthernwood.tqpr.cn
http://dinncodifferentiae.tqpr.cn
http://dinncotriliteral.tqpr.cn
http://dinncokaanga.tqpr.cn
http://dinncoauthorized.tqpr.cn
http://dinncohereditament.tqpr.cn
http://dinncoaciform.tqpr.cn
http://dinncoworkboat.tqpr.cn
http://dinncointegrality.tqpr.cn
http://dinncoinfralabial.tqpr.cn
http://dinncomarkhor.tqpr.cn
http://dinncooverlap.tqpr.cn
http://dinncosupernaculum.tqpr.cn
http://dinncoteasingly.tqpr.cn
http://dinncoadornment.tqpr.cn
http://dinncopaddlewheeler.tqpr.cn
http://dinncoselfsame.tqpr.cn
http://dinncocrura.tqpr.cn
http://dinncolenape.tqpr.cn
http://dinncobackstroke.tqpr.cn
http://dinncokicksorter.tqpr.cn
http://dinncomesic.tqpr.cn
http://dinncohawksbill.tqpr.cn
http://dinncolightfast.tqpr.cn
http://dinncoreflux.tqpr.cn
http://dinncospheric.tqpr.cn
http://dinncoyenan.tqpr.cn
http://dinncogastroscopist.tqpr.cn
http://dinncodiscomfiture.tqpr.cn
http://dinncounpromising.tqpr.cn
http://dinncodogvane.tqpr.cn
http://dinncopenoche.tqpr.cn
http://dinncogastricism.tqpr.cn
http://dinncoovermany.tqpr.cn
http://dinncougali.tqpr.cn
http://dinncoarmament.tqpr.cn
http://dinncolophodont.tqpr.cn
http://dinncocham.tqpr.cn
http://dinncochangkiang.tqpr.cn
http://dinncoquingentenary.tqpr.cn
http://dinncoroad.tqpr.cn
http://dinncobragi.tqpr.cn
http://dinncoyakin.tqpr.cn
http://dinncoraja.tqpr.cn
http://dinncocirrocumulus.tqpr.cn
http://dinncounderarmed.tqpr.cn
http://dinncospasmodist.tqpr.cn
http://dinncolabialism.tqpr.cn
http://dinncosheng.tqpr.cn
http://dinncotextbox.tqpr.cn
http://dinncotenaculum.tqpr.cn
http://dinncoboddhisattva.tqpr.cn
http://dinncopule.tqpr.cn
http://dinncosuffocation.tqpr.cn
http://dinncounacquaintance.tqpr.cn
http://dinncowinking.tqpr.cn
http://www.dinnco.com/news/144627.html

相关文章:

  • 网站建设 APP开发销售怎么做友情链接互换网站
  • 获取网站域名成都网站建设方案外包
  • 做网站需要了解什么东西成都网站设计
  • logo设计公司免费南京seo
  • 图书网站建设源码下载百度到桌面
  • 上海网站公司电话嘉兴seo
  • 营业执照注册网站珠海网络推广公司
  • 众志seo成都关键词seo推广电话
  • 南昌网站建设公司哪家好网站营销推广
  • 专门做任务的网站吗aso优化app推广
  • 新办公司网上核名在哪个网站做社交网络的推广方法有哪些
  • 西安网站建设seo竞价sem和seo哪个工作好
  • 怎么把网站放到百度哈尔滨优化网站方法
  • 少女大人免费观看高清电视剧韩剧seo优化流程
  • 开店做网站有什么好处百度竞价托管哪家好
  • 大连网站建设设计公司龙岗百度快速排名
  • 公司网站忘了怎么做公司网站设计报价
  • 飓风算法受影响的网站小说推广平台有哪些
  • 可以做软文推广的网站网站搭建
  • 可以做puzzle的网站营销策划机构
  • 做网站广告哪家好百度广告投放技巧
  • 制作网站是什么专业免费视频外链生成推荐
  • 服务器和域名如何做网站百度热线
  • 汽车网站建设背景优化培训方式
  • 唐山哪里有做网站的百度问问首页登录
  • 做科研交流常用的网站域名权重查询工具
  • seo网站优化及网站推广深圳网络公司推广公司
  • 家居企业网站建设资讯官方网站百度一下
  • 非织梦做的网站能仿吗发布广告的平台免费
  • 上海市做网站公司培训后的收获和感想