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

古董做推广哪个网站好建e室内设计网官网图库

古董做推广哪个网站好,建e室内设计网官网图库,珠海高端网站建设报价,贸易公司网站建设方案欢迎来到程序小院 伐木猪 玩法&#xff1a;控制小猪点击屏幕左右砍树&#xff0c;不能碰到树枝&#xff0c;考验手速与眼力&#xff0c;记录分数&#xff0c;快去挑战伐木吧^^。开始游戏https://www.ormcc.com/play/gameStart/199 html <script type"text/javascript…

欢迎来到程序小院

伐木猪

玩法:控制小猪点击屏幕左右砍树,不能碰到树枝,考验手速与眼力,记录分数,快去挑战伐木吧^^。

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

html

<script type="text/javascript" src="js/state/boot.js"></script>
<script type="text/javascript" src="js/state/load.js"></script>
<script type="text/javascript" src="js/state/menu.js"></script>
<script type="text/javascript" src="js/state/play.js"></script>
<script type="text/javascript" src="js/state/demo.js"></script>

css

*{padding: 0;margin: 0;border: none;user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box;
}
canvas{margin: 0 auto;
}

js

var isStart = 0;
window.Timberpig.state.demo = {create: function(){var game = this;var j = 0; //当第一次按下 不执行var tweenA,tweenB;this.background = mt.create("background"); //创建背景this.ground = mt.create("ground");   //创建地面this.cloud = mt.create("cloud");   //创建云层this.cloud.update = function(){    //云层动画for(var i = 0; i < this.length; i++){if(this.getChildAt(i).x + this.getChildAt(i).width < 0){this.getChildAt(i).x = game.world.width;this.getChildAt(i).y = game.rnd.between(game.world.centerY / 2,game.world.centerY / 1.5);}this.getChildAt(i).x--;}};this.tree = mt.create("tree");      //创建树木this.title = mt.create("title");     //创建标题tweenA = game.add.tween(this.title).to( { y: this.title.y + 100 }, 2000, "Linear");tweenB = game.add.tween(this.title).to( { y: this.title.y }, 2000, "Linear");tweenA.chain(tweenB);        //缓动动画tweenB.chain(tweenA);        //动画链接tweenA.start();          //播放动画this.title.update = function(){if(isStart == 1){this.destroy();}};this.Score = mt.create("Score");this.Score.alpha = 0;var Score = this.Score;this.btnPlay = mt.create("btnPlay");    //开始按钮this.btnPlay.inputEnabled = true;     //接收事件this.btnPlay.events.onInputDown.addOnce(function(){ //鼠标点击事件j = 2;isStart = 1;Score.alpha = 1;});this.btnPlay.update = function(){if(isStart == 1){this.destroy();}};this.player = mt.create("player");var player = this.player;this.player.dt = 0;this.player.frameIndex = this.player.frame;var cutA = this.player.animations.add('cut', [0, 1, 2]);this.player.animations.add('gif', [0, 7]);this.player.animations.add('die',[12,11,10,4,3,8,9,6,5],10,false);cutA.onComplete.add(function(){player.animations.play('gif',5,true);}, this);this.player.anchor.set(0.5,0);this.player.leftX = 184;this.player.rightX = 354;this.player.x = this.player.leftX;this.player.update = function(){
//    this.dt++;
//    if(this.dt % 10 === 0){
//     if(this.frameIndex === 0){
//      //console.log("a");
//      this.frameIndex = 7;
//     } else {
//      //console.log("b");
//      this.frameIndex = 0;
//     }
//    }
//    this.frame = this.frameIndex;//播放人物常态动画if(isStart == 1){if (j <= 1) return false;if (game.input.activePointer.isDown){//游戏内鼠标点击if(game.input.activePointer.x < game.world.centerX){this.x = this.leftX;this.scaleX = 1;} else {this.x = this.rightX;this.scaleX = -1;}//this.animations.play('cut');cutA.play(10,false);}}};this.gameOver = mt.create("gameOver");this.gameOver.alpha = 0;this.gameOver.getData().userData.score = 0;this.gameOver.update = function(){if(isStart !== 2) {return false}if(isStart == 2){Score.destroy();this.mt.children.gameCase.setText(this.getData().userData.case);this.mt.children.gameScore.setText(this.getData().userData.score);this.mt.children.gameCase.x = game.world.centerX;this.mt.children.gameScore.x = game.world.centerX;this.alpha = 0.9;if(this.getData().userData.case == "Lost"){//死亡动画player.scaleY = 1;//player.frame = 5;player.animations.play('die');}isStart = 3;}};this.gameOver.mt.children.btnRetry.inputEnabled = true;this.gameOver.mt.children.btnRetry.events.onInputDown.addOnce(function(){game.state.start("demo");},this);var gameOver = this.gameOver;this.time = mt.create("time");this.time.alpha = 0;this.time.update = function(){if(isStart == 1){this.alpha = 1;this.mt.children.top.width--;if(this.mt.children.top.width <= 0){this.alpha = 0;gameOver.getData().userData.case = "Lost";isStart = 2;}}if(isStart == 2){this.alpha = 0;}};var dx1 = 0,dx2 = 0;game.input.onDown.add(function(){if(isStart == 1){//游戏内鼠标点击if(game.input.activePointer.x < game.world.centerX){//leftdx1 = 50;dx2 = 100;} else {//rightdx1 = -50;dx2 = -100;}for(var i = 1;i < this.tree.length;i++){if(this.tree.getChildAt(i).y + this.tree.getChildAt(i).height >= this.tree.getChildAt(0).y){//创建动画var animation = game.add.image(this.tree.getChildAt(i).x,this.tree.getChildAt(i).y,"");animation.texture = this.tree.getChildAt(i).texture;tweenA = game.add.tween(animation).to( { x: animation.x + dx1,y: animation.y - 50  }, 300, "Linear");tweenB = game.add.tween(animation).to( { x: animation.x + dx2,y: animation.y + 50 }, 300, "Linear");        //缓动动画tweenB.onComplete.add(function(){animation.destroy();},this);tweenA.chain(tweenB);tweenA.start(); /播放动画//销毁树桩上的一段木头this.tree.getChildAt(i).destroy();//游戏得分递增this.gameOver.getData().userData.score++;this.time.mt.children.top.width += 5;if(this.gameOver.getData().userData.score == 49){this.gameOver.getData().userData.case = "Win";isStart = 2;}} }for(var i = 1;i < this.tree.length;i++){//被砍往下掉this.tree.getChildAt(i).y += 57;if(this.tree.getChildAt(i).y + this.tree.getChildAt(i).height >= this.tree.getChildAt(0).y){//防止越界this.tree.getChildAt(i).y = this.tree.getChildAt(0).y - this.tree.getChildAt(i).height;}}}},this);},update:function(){if(isStart !== 1) return false;this.Score.text = this.gameOver.getData().userData.score;var gameOver = this.gameOver;this.game.physics.arcade.overlap(this.player,this.tree,function(){//console.log("游戏结束");gameOver.getData().userData.case = "Lost";isStart = 2;});}
};

源码icon-default.png?t=N7T8https://www.ormcc.com/

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

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

http://www.bjxfkj.com.cn/article/109580.html

相关文章:

  • 图像处理专业网站四川省建设厅官方培训网站
  • 做网站用什么框架建设网站公司专业
  • 怎么办网站做网站属于什么技术
  • 优秀网站建设模板如何选择合肥网站建设
  • 大学生期末作业建设网站wordpress侧栏菜单加上序号
  • 网站建设遵循原则大连招投标网官网
  • 怎么创建自己的网站wordpress为什么是英文版
  • 怎样做音视频宣传网站四川南充网站建设
  • 做一个手机网站多少钱网站做m版
  • 做网站买域名要买几个后缀最安全软件大全下载app免费
  • 北京最好的网站建设公司设计公司排名前十
  • 拍卖网站模板整合营销方案怎么写
  • 廉政建设网站网站内部链接的策略
  • 先备案先建网站重庆网站设计重庆最加科技
  • 凡诺企业网站管理系统菏泽微信小程序制作
  • 网站seo技术能不能赚钱农村电子商务网站建设方案
  • 深圳做小程序网站设计高端网站建设推来客地址
  • 在线制作插画网站荣成市有做网站的吗
  • 中企动力做的网站好吗邹城网站建设v556
  • 网络营销网站设计网站上线步骤 icp备案
  • 网站文章多久才收录作品 上海高端网站设计
  • 南京网站群建设公司网页游戏排行榜第一名
  • 深圳专业做网站建设青岛建设网站的公司
  • 靖州建设局网站做网站注册公司
  • 厦门网站建设 孚珀科技做网站排名费用多少
  • 建网站多少费用互联购物
  • 如何登录中国建设银行网站网站建设确认表
  • 论坛网站需要多大的空间网页设计师的工作
  • 怎么看网站是不是做竞价数据分析师报考条件
  • 找人做效果土去那网站找郑州专业手机网站制作