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

wap蓝天建站小吃培训机构排名前十

wap蓝天建站,小吃培训机构排名前十,网站建设 团队,贵州网站建设kuhugz欢迎来到程序小院 机器人向前冲 玩法:一直走动的机器人,点击鼠标左键进行跳跃,跳过不同的匝道,掉下去即为游戏接续, 碰到匝道铁钉游戏结束,一直往前冲吧^^。开始游戏https://www.ormcc.com/play/gameStart…

欢迎来到程序小院

机器人向前冲

玩法:一直走动的机器人,点击鼠标左键进行跳跃,跳过不同的匝道,掉下去即为游戏接续,
碰到匝道铁钉游戏结束,一直往前冲吧^^。

开始游戏icon-default.png?t=N7T8https://www.ormcc.com/play/gameStart/206

html

  <canvas width="1280" height="768"></canvas>

css

canvas {display: block;touch-action: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width: 680px; height: 408px; cursor: inherit; margin-left: 0px; margin-top: 71px; margin-bottom: -71px;"
}

js

var game = new Phaser.Game(1280, 768, Phaser.AUTO, '');
game.state.add('Boot', BasicGame.Boot);
game.state.add('Preloader', BasicGame.Preloader);
game.state.add('MainMenu', BasicGame.MainMenu);
game.state.add('Game', BasicGame.Game);
// Now start the Boot state.
game.state.start('Boot');
BasicGame.Game.prototype = {
create: function () {this.map = this.game.add.tilemap('map');this.map.addTilesetImage('gem');this.map.addTilesetImage('platforms');this.map.setTileIndexCallback(61,this.hitCoin,this);this.map.setTileIndexCallback(24,this.dead,this);this.map.setTileIndexCallback(25,this.dead,this);this.layer = this.map.createLayer('Tile Layer 1');this.layer.resizeWorld();this.map.setCollisionBetween(1,10);this.map.setCollisionBetween(13,20);this.map.setCollisionBetween(23,37);this.map.setCollisionBetween(39,45);this.map.setCollisionBetween(49,60);this.sprite = this.game.add.sprite(75,600,'hero');this.sprite.animations.add('run',[0,1,2,3,4,5,6,7],16,true);this.game.physics.enable(this.sprite);this.sprite.body.bounce.set(0);this.sprite.body.tilePadding.set(64);this.game.camera.follow(this.sprite);this.sprite.body.gravity.y = 1200;this.game.input.onDown.add(this.jump,this);this.game.physics.startSystem(Phaser.Physics.ARCADE);this.game.physics.arcade.TILE_BIAS = 50;this.playing = true;
},jump: function() {if (this.sprite.body.blocked.down) {this.sprite.body.velocity.y = -720;this.sprite.animations.stop();this.sprite.frame = 2;}},
update: function () {this.game.physics.arcade.collide(this.sprite,this.layer);if (this.sprite.body.blocked.right) {this.sprite.body.velocity.x = 0;} else {this.sprite.body.velocity.x = 300;}if (this.sprite.body.blocked.down) {this.sprite.animations.play('run');}if (this.sprite.x > 7460) {console.log("win");this.playing=false;}if (this.sprite.y > 760) {this.dead();}this.quitGame(this.playing);
},
quitGame: function (pointer) {if(!this.playing) {delete this.map;delete this.layer;delete this.sprite;//takes us back to Main Menuthis.state.start('MainMenu');}
},hitCoin: function (sprite,tile) {if (tile.alpha != 0) {tile.alpha = 0;this.layer.dirty = true;return false;}},dead: function () {console.log("dead");this.playing=false;}
};

源码

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

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

http://www.yidumall.com/news/100270.html

相关文章:

  • nodejs做企业网站淘宝营销推广方案
  • 怎么做房地产网站登录百度
  • 网页视频下载在线提取关键词优化排名
  • 公明做企业网站南京市网站seo整站优化
  • 网络公司做网站百度客服24小时人工电话
  • 网站进行诊断谷歌搜索引擎下载
  • 长沙必去十大网红地方深圳品牌seo
  • 诸城网站建设定制新网站多久会被百度收录
  • 广州市政府门户网站介绍产品软文
  • 专业做书画推广的网站快速搭建网站的工具
  • 做网站用的服务器网上推广app怎么做
  • 政府网站建设意义品牌推广和营销推广
  • 做征婚网站有哪些东莞整站优化
  • 文创产品设计说明模板石家庄手机端seo
  • 无锡 网站建设网站搜索引擎优化情况怎么写
  • 新形势下政府网站建设免费服务器
  • 像网站的ppt怎么做头条关键词排名查询
  • 手机网站自适应布局怎么做百度官方网首页
  • 网站 如何做 中英文切换长沙seo公司排名
  • wordpress 调用小工具栏北京网站seo服务
  • 网站建设的现状和趋势佛山网站快速排名提升
  • 个人网站搭建详细步骤加强服务保障 满足群众急需需求
  • 如何办理网站人工智能的关键词
  • 电脑上怎么做网站开封网站推广
  • 网站官网设计规范seo排名是什么意思
  • win7怎么做网站域名绑定挖掘关键词爱站网
  • 做网站什么软件产品推广方案范文500字
  • 做网站必须要电脑吗引擎seo优
  • 自己的做网站yw77731域名查询
  • 网站程序引擎电脑培训网上培训班