远方的海
远方的海,WordPress,免费
2014 Aug 12 03 : 39

微信小游戏源码:神经猫和打企鹅源码分享

您当前的位置: 首页 > 娱乐前线 > 微信 > 正文
欢迎光临远方的海!您可能还对 WordPress建站免费资源最新IT动态 感兴趣,点击开启 悦读 模式。CTRL+D 快捷收藏本文,我们期待您再次光临!
[文章目录]

下面给出几个微信朋友圈小游戏的源码(围住神经猫源码,疯狂打企鹅源码),本站仅提供代码仅作学习和参考,版权归原作者所有!

围住神经猫代码

<!DOCTYPE html> 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>感觉萌萌哒~围住神经猫</title>
    <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no,target-densitydpi=device-dpi">
    <meta name="apple-mobile-web-app-capable" content="yes">

    <meta name="full-screen" content="true">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="360-fullscreen" content="true">
<base href=".">
    <style>
        body {
            text-align: center;
            background: #000000;
            padding: 0;
            border: 0;
            margin: 0;
            height: 100%;
        }

        html {
            -ms-touch-action: none; /* Direct all pointer events to JavaScript code. */
        }
        .sbgshow{display:block;position:fixed;top:0;left:0;width:100%;height:100%;text-align:center;color:#fff;font-size:30px;line-height:1.7em;background:rgba(0,0,0,0.85);}
        .sbgshow .arron{ position:absolute;top:8px;right:8px;width:100px;height:100px;background:url(./arron.png) no-repeat; background-size:100px 100px;}
        .sbgshow p{padding-top:78px;}
        .sbg{display:none;position:fixed;top:0;left:0;width:100%;height:100%;text-align:center;color:#fff;font-size:26px;line-height:1.7em;background:rgba(0,0,0,0.85);}
        .sbg .arron{ position:absolute;top:8px;right:8px;width:100px;height:100px;background:url(./arron.png) no-repeat; background-size:100px 100px;}
        .sbg p{padding-top:78px;}
		.aliForPc {display:none;position:fixed;top:5px;right:5px;width:200px;height:230px;overflow:hidden;z-index:99999;}
    </style>
</head>
<body>
<div style="display:inline-block;width:100%; height:100%;margin: 0 auto; background: black; position:relative;" id="gameDiv">
    <canvas id="gameCanvas" width="480" height="800" style="background-color: #000000"></canvas>
</div>
<div class="aliForPc"><img src="forpc.png" /></div>
<div id="sbg" class="sbg">
    <div class="arron"></div>
    <p id="msg">请点击右上角<br>点击【分享到朋友圈】<br>测测好友的神经指数吧!</p>
</div>
<script>var document_class = "GameApp";</script><!--这部分内容在编译时会被替换,要修改文档类,请到工程目录下的egretProperties.json内编辑。-->
 <script language="javascript" type="text/javascript" src="../resource/js/resource_loader.js?ver=255"></script>
<script src="./index_files/egret_loader.js"></script>
<script src="./index_files/game-min-0722.js?223"></script>

<script>
	var mebtnopenurl = 'http://u.ali213.net/?wx';
		window.shareData = {
		        "imgUrl": "http://domain.com/games/shenjingcat/shenjingcat.png",
		        "timeLineLink": "http://domain.com/games/shenjingcat/index.html?game_code=196&bs=wx",
		        "tTitle": "围住神经猫-根本停不下来,玩过之后我整个人都精神了!",
		        "tContent": "在9×9范围内的格子中,使用色块围住白色神经猫。"
		}		
    function showme(){
        window.location.href="http://mp.weixin.qq.com/s?__biz=xxxxxx";
    }
    function dp_share(n , m){
        if(m == 0){
            document.title = window.shareData.tContent = "围住神经猫-根本停不下来,玩过之后我整个人都精神了!"
        }
        if(m == 1){
            document.title = window.shareData.tContent = "我用了"+n+"步围住神经猫,击败"+(100-n)+"%的人,你能超过我吗?"
        }
        if(m == 2){
            document.title = window.shareData.tContent = "我没有围住它,谁能帮个忙?"
        }
        document.getElementById("sbg").className="sbgshow";
        window.setTimeout(hiddenMe, 5000);
    }

    function hiddenMe(){
        document.getElementById("sbg").className="sbg";
    }
	
    egret_h5.startGame();
	$j(document).ready(function(){
		if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
			//
		}else{
			$j(".aliForPc").show();
		}
	});
</script>
</body>
<div style="display:none;">
</div>
</html>

js代码部分在这里下载:点击下载

疯狂打企鹅

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <title>打企鹅</title>
		<script type="text/javascript">
		var _config = {}; _config['isSite'] = 'http://domain.com/';_config["isCount"] = "http://xxx/";_config["isSites"] = "http://domain.com/"; 
var _con = {}; _con["num"] = 5232567; </script> 
<script type="text/javascript" src="//xxx/js/jquery.min.js"></script> <script type="text/javascript" src="//xxx/js/52/createjs.min.js"></script> <script type="text/javascript" src="//xxx/js/52/zepto.min.js"></script> <script src="//xxx/js/52/common.js"></script> <style> body,html{padding:0;margin:0;width:100%;height:100%;background:#000;-webkit-tap-highlight-color:transparent;} canvas{width:100%;height:100%;}#container{position:absolute;bottom:0;left:0;width:100%;height:100%;}.bt-animation{-webkit-transition:all 200ms;-moz-transition:all 200ms;-ms-transition:all 200ms;-o-transition:all 200ms;transition:all 200ms;}.bt-advertisement,.bt-h-scrren,.bt-v-scrren,.bt-play-logo-adv,.bt-play-share-tip{position:absolute;top:0;left:0;z-index:6000;width:100%;height:100%;text-align:center;font-size:16px;color:#fff;}#bt-play-logo-adv{z-index:9001;}#bt-play-logo-adv-lock{z-index:9000;}.bt-play-share-tip{text-align:right;}.bt-play-share-tip-img{margin:10px 2%0 0;width:60%;max-width:180px;}.bt-h-scrren,.bt-v-scrren{background:#fff;}.bt-h-scrren table,.bt-h-scrren tr,.bt-h-scrren td,.bt-v-scrren table,.bt-v-scrren tr,.bt-v-scrren td{width:100%;height:100%;padding:0;margin:0;}.bt-h-screen-img,.bt-v-screen-img{margin:10px 1%;max-width:98%;}.bt-lock-screen{position:absolute;top:0;left:0;z-index:5000;width:100%;height:100%;opacity:0.4;background:#000;}#bt-hide-lock{z-index:-1;}.bt-game-loading{position:fixed;position:absolute;top:0;left:0;width:100%;height:100%;font-size:1.6rem;text-align:center;color:gray;background:#fff;}.bt-game-loading table,.bt-game-loading tr,.bt-game-loading td{height:100%;width:100%;padding:0;margin:0;}.bt-game-loading.bt-img{width:452px;max-width:70%;}.bt-game-loading.bt-text{padding-top:30px;}.bt-hide{overflow:hidden!important;width:0!important;height:0!important;opacity:0!important;margin:0!important;padding:0!important;} #share-wx{ background:rgba(0,0,0,0.8); position:absolute;top:0px; left:0px; width:100%; height:100%; z-index:10000; display:none; } #wx-qr{ background:rgba(0,0,0,0.8); position:absolute;top:0px; left:0px; width:100%; height:100%; z-index:10000; display:none; } .lis{overflow: hidden;width: 100%;z-index: 99999;position: absolute;top:0;} .lis a{display: block;width:99.9%;color:#ffffff;font-size:14px;text-decoration: none;background:#606783;text-align: center;opacity: 0.5;line-height:30px;font-weight: bold;font-family:"微软雅黑"} .lis a img{position: relative;top: 1px;} </style> </head> <body> <script type="text/javascript" src="//xxx/js/code.js"></script> <div class="lis"> <div style="float: left;width:33%;"><a style="border-bottom: 3px solid #fd6766;" href="/game/">游戏列表</a></div> <div style="float: left;width:34%;"><a style="border-bottom: 3px solid #04fece;" href="/top/">关注收藏</a></div> <div style="float: left;width:33%;"><a style="width:100%;margin:0;border-bottom: 3px solid #fdcd01;" onclick="location.href=location.href;" href="javascript:;" ><img width="15" src="//xxx.cn/vapp/4.png">重玩</a></div> </div> <div id="container"> <canvas id="canvas"></canvas> </div> <div style="display: none;"> </div> <script src="//domain.com/js/52/index.js"></script> <script src="//xxx/js/52/flyline.js"></script> <script language=javascript> var mebtnopenurl = 'http://xxx/game/'; var rankurl = mebtnopenurl; dataForWeixin = { "appId": "wxed02a5c1d8d51d54", "imgUrl": "http://xxx.cn/vapp/52/3.jpg", "url": "http://domain.com/game/5232567/", "tTitle": "打企鹅-游戏", "tContent": "打企鹅-游戏" }; function goHome(){ window.location=mebtnopenurl; } function clickMore(){ if((window.location+"").indexOf("zf",1)>0){ window.location = mebtnopenurl; } else{ goHome(); } } function dp_Ranking() { window.location = rankurl; } document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() { WeixinJSBridge.on('menu:share:appmessage', function(argv) { WeixinJSBridge.invoke('sendAppMessage', { "appid": dataForWeixin.appId, "img_url": dataForWeixin.imgUrl, "link": dataForWeixin.url, "desc": dataForWeixin.tContent, "title": dataForWeixin.tTitle }); setTimeout(function () {location.href = mebtnopenurl;}, 1500); }); WeixinJSBridge.on('menu:share:timeline', function(argv) { WeixinJSBridge.invoke('shareTimeline', { "appid": dataForWeixin.appId, "img_url": dataForWeixin.imgUrl, "img_width": "640", "img_height": "640", "link": dataForWeixin.url, "desc": dataForWeixin.tContent, "title": dataForWeixin.tTitle }); setTimeout(function () {location.href = mebtnopenurl;}, 1500); }); }, false); function dp_share(){ document.title ="你简直霸气侧漏,把企鹅击飞出"+myData.scoreName+",谁还能超越我?"; document.getElementById("share").style.display=""; dataForWeixin.tTitle = document.title; } </script> <div id="share" style="display: none"> <img width="100%" src="//xxx/vapp/51/shares.png" style="position: fixed; z-index: 9999; top: 0; left: 0;" ontouchstart="document.getElementById('share').style.display='none';"> </div> <div style="display: none;"> <script type="text/javascript"> var myData = {}; function dp_submitScore(score){ myData.score = score*10; myData.scoreName = score+"米"; if(score>0){ if (confirm("你太猛了,大力出奇迹,一下把伦家击飞"+score+"米!要不要通知一下小伙伴")){ dp_share(); } } } </script> </div> <script type="text/javascript" src="//weiapp.552200.com/js/config.main.js/"></script> <div> <script type="text/javascript"> /*20:3底部悬*/ var cpro_id = "u1639910"; </script>  </div> <div style="display:none;"> </div> </body> </html>

js代码部分在这里下载:点击下载

好文!分享给朋友,或者点个赞吧~

文章信息

分类:微信

您可能也会喜欢

发表回复

Post Comment


  1. Bto :

    速度还可以 。感觉挺好的呢。我的也是才建个多星期呢。哈哈,欢迎来访啊

    2014-8-12
    • 远方的海水神 :

      已经回访~

      2014-8-12
    • 远方的海水神 :

      之前我也做过咨询站,后来发现就是自娱自乐,也没流量,就没做了。

      2014-8-12