飞翔吧,小帅

欢迎来到程序小院

飞翔吧,小帅

玩法:点击鼠标左键控制飞翔,不要让小帅落下,遇到障碍物从中间飞过,看看小帅能飞翔多少米,快去飞行吧^^。

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

html

<div id="infos" style="display:none"></div>
<div style="overflow: hidden;" align="center" id="bai">
 <div style="display: inline;float: left;">
   </div>
</div>

css

#GameCanvas {
	margin-bottom: -4px;
	position: relative;
	z-index: 1;
	max-height: 100%;
	max-width: 100%;
}

#GameCanvasBOX {
	background: url("./vapp/7/background2.png") left center;
	background-size: 100% 100%;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
	height: 910px;
}

js

var gameCounter, gameCounterText = 0;
var t;
$$.onready(function() {
    setHeight();
    gameCounter = getElement('#gameCounter');
    fb.fn.setCounter = function(n) {};
    fb.fn.dead = function() {
        setTimeout(function() {
            showDieMenu();
        },
        200);
        return true;
    }
    fb.fn.alertRelive = function() {
        setTimeout(function() {
            showDieMenu(true);
        },
        200);
        return true;
    }
    fb.fn.restart = function() {
        gameCounter.css('display', 'block');
    }
    fb.init('GameCanvas',
    function() {
        getElement('#startLayer').onclick = function() {
            var n = 2;
            gameCounter.innerHTML = '<img class="FBfont" src="' + _config['isSite'] +
            'vapp/7/f_1.png"/><img class="FBfont" src="' + _config['isSite'] + 
            'vapp/7/f_0.png"/><img class="FBfont" src="' + _config['isSite'] + 
            'vapp/7/f_0.png"/>';
            t = setInterval(function() {
                n = n + '';
                var num = ''
                for (var i = 0,
                len = n.length; i < len; i++) {
                    num += '<img class="FBfont" src="' + _config['isSite'] + 
                    'vapp/7/f_' + n[i] + '.png"/>';
                }
                gameCounter.innerHTML = num + '<img class="FBfont" src="' + 
                _config['isSite'] + 'vapp/7/f_0.png"/><img class="FBfont" src="' + 
                _config['isSite'] + 'vapp/7/f_0.png"/>';
                fb.status.score = n;
                n++;
            },
            1000);
            getElement('#startLayer').rm();
            gameCounter.css('display', 'block');
            setTimeout(function() {
                createjs.Sound.play("Menu");
                fb.birdJump();
            },
            300)
        };
        getElement('#restart-btn').onclick = function() {
            clearInterval(t);
            gameCounter.innerHTML = '<img class="FBfont" src="' + _config['isSite'] + 
            'vapp/7/f_1.png"/><img class="FBfont" src="' + _config['isSite'] + 
            'vapp/7/f_0.png"/><img class="FBfont" src="' + _config['isSite'] + 
            'vapp/7/f_0.png"/>';
            var n = 2;
            t = setInterval(function() {
                n = n + '';
                var num = ''
                for (var i = 0,
                len = n.length; i < len; i++) {
                    num += '<img class="FBfont" src="' + _config['isSite'] + 
                    'vapp/7/f_' + n[i] + '.png"/>';
                }
                gameCounter.innerHTML = num + '<img class="FBfont" src="' + 
                _config['isSite'] + 'vapp/7/f_0.png"/><img class="FBfont" src="' + 
                _config['isSite'] + 'vapp/7/f_0.png"/>';
                fb.status.score = n;
                n++;
            },
            1000);
            hideDieMenu();
            fb.restart();
        };
    });
}) $$.onresize(function() {
    setHeight();
}) function setHeight() {
    var c = document.getElementById('GameCanvas');
    c.style.height = window.innerHeight + 'px';
    c.style.width = window.innerWidth + 'px';
}
function showDieMenu(relive, callback) {
    createjs.Sound.play("Menu");
    var n = fb.status.score + '';
    var num = ''
    for (var i = 0,
    len = n.length; i < len; i++) {
        num += '<img class="FBfont" src="' + _config['isSite'] + 'vapp/7/f_' + n[i] +
        '.png"/>';
    }
    getElement('#gameScoreText').innerHTML = num + '<img class="FBfont" src="' + 
    _config['isSite'] + 'vapp/7/f_0.png"/><img class="FBfont" src="' + _config['isSite'] + 
    'vapp/7/f_0.png"/>';
    gameCounter.css('display', 'none');
    getElement('#gameMenuLayer').rmCls('HIDE');
    getElement('#gameName').addCls('HIDE');
    dataForWeixin.title = "酷跑炫飞模式即将登场,我的小帅飞了" + fb.status.score + "00米,你呢?";
    dataForWeixin.desc = "酷跑炫飞模式即将登场,我的小帅飞了" + fb.status.score + "00米,你呢?";
}
function hideDieMenu(callback) {
    createjs.Sound.play("Menu");
    getElement('#gameMenuLayer').addCls('HIDE');
    getElement('#gameName').rmCls('HIDE');
    gameCounter.css('display', 'block');
    dataForWeixin.title = "听说酷跑变成炫飞了?来试试让金枪小帅飞翔起来,比比谁飞得更远!";
    dataForWeixin.desc = "听说酷跑变成炫飞了?来试试让金枪小帅飞翔起来,比比谁飞得更远!";
}
function isWeixin() {
 var e = navigator.userAgent.toLowerCase();
 if (e.match(/MicroMessenger/i) == "micromessenger") {
  return true
 } else {
  return false
 }
}
function closeshare() {
 document.getElementById("share-wx").style.display = "none"
}
function closewx() {
 document.getElementById("wx-qr").style.display = "none"
}
function addShareWX() {
 var e = document.createElement("div");
 e.id = "share-wx";
 e.onclick = closeshare;
 document.body.appendChild(e);
 var t = document.createElement("p");
 t.style.cssText = "text-align:right;padding-left:10px;";
 e.appendChild(t);
}
function addWXQR() {
 var e = document.createElement("div");
 e.style.cssText = "background:rgba(0,0,0,0.8); position:fixed;top:0px; left:0px; 
  width:100%; height:" + document.height + "px; z-index:10000; display:none;";
 e.id = "wx-qr";
 e.onclick = closewx;
 document.body.appendChild(e);
 wxqrP1 = document.createElement("p");
 wxqrP1.style.cssText = "text-align:center;width:220px;color:#fff;
  margin:50px auto 0 auto;font: bold 16px Arial, Helvetica, Microsoft Yahei, 微软雅黑, 
  STXihei, 华文细黑, sans-serif";
 wxqrP1.innerHTML = "分享给朋友一起玩!";
 e.appendChild(wxqrP1);
}

if (getCookie("num")) {
 var nn = parseInt(getCookie("num"));
 setCookie("num", ++nn);
} else {
 setCookie("num", 1);
}
function getCookie(name) 
{ 
 var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); 
 if(arr=document.cookie.match(reg)) return unescape(arr[2]); 
 else return null; 
} 
function setCookie(name, value) {
 var Days = 30;
 var exp = new Date();
 exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
 document.cookie = name + "=" + escape(value) + ";expires" + exp.toGMTString();
}
 
function isMobile() {
 return navigator.userAgent.match(/android|iphone|ipod|blackberry|meego|symbianos|
  windowsphone|ucbrowser/i)
}
function isIOS() {
 return navigator.userAgent.match(/iphone|ipod|ios/i)
}
var RESOURCE_IMG_PATH = RESOURCE_IMG_PATH || "/vapp/",
HORIZONTAL = HORIZONTAL || false,
COVER_SHOW_TIME = COVER_SHOW_TIME || 2e3;
document.addEventListener("WeixinJSBridgeReady",
function() {
 if (HORIZONTAL == true) {
  WeixinJSBridge.call("hideToolbar")
 }
},
false); (function() {
 function n() {
  window.scroll(0, 0);
  var e;
  if (window.orientation == 0 || window.orientation == 180) {
   e = false
  } else if (window.orientation == -90 || window.orientation == 90) {
   e = true
  }
  if (e == HORIZONTAL) {
   t.style.display = "none"
  } else {
   setTimeout(function() {
    r();
    t.style.width = window.innerWidth + "px";
    t.style.display = "block"
   },
   isIOS() ? 0 : 600)
  }
  if (HORIZONTAL == true && isWeixin() && !isIOS()) {
   WeixinJSBridge.call("hideToolbar")
  }
 }
 function r() {
  e.style.height = window.innerHeight + "px";
  e.style.width = window.innerWidth + "px";
  t.style.height = window.innerHeight + "px"
 }
 if (!isMobile()) return;
 var e = document.createElement("div");
 e.style.cssText = "position:absolute;z-index:1000000;left:0;top:0;
  background:#6699ff url(" + RESOURCE_IMG_PATH + "cover.jpg) no-repeat center center;
  background-size: 50%;width:" + window.innerWidth + "px;height:" + 
  Math.max(window.innerHeight, window.document.documentElement.offsetHeight) + "px";
 e.className = "common_cover";
 document.body.appendChild(e);
 setTimeout(function() {
  e.parentNode.removeChild(e)
 },
 COVER_SHOW_TIME);
 document.addEventListener("touchmove",
 function(e) {
  e.preventDefault()
 },
 false);
 var t = document.createElement("div");
 t.className = "common_notice";
 t.style.cssText = "position:absolute;z-index:999999;left:0;top:0;
  background:#6699ff url(" + RESOURCE_IMG_PATH + "rotate_tip.jpg) no-repeat center center;
  background-size: 50%;";
 document.body.appendChild(t);
 window.addEventListener("orientationchange", n);
 window.addEventListener("load", n);
 window.addEventListener("scroll", r)
})();
document.oncontextmenu = function() {
 return false
};
if (isWeixin()) {
 addShareWX()
} else {
 addWXQR()
}

源码

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

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

  • 12
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值