H5游戏源码分享-像素小鸟游戏(类似深海潜艇)

H5游戏源码分享-像素小鸟游戏(类似深海潜艇)

点击屏幕控制小鸟的飞行高度

整个小游戏就用JS完成

项目地址:https://download.csdn.net/download/Highning0007/88483228

html 复制代码
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta id="viewport" name="viewport" content="width=device-width,user-scalable=no" />
		<script type="text/javascript" src="21.js"></script>
        <title>小鸟飞飞飞-微资源娱乐小游戏</title>
		<style type="text/css">
			body {
				margin:0px;
			}
		</style>
		<script language=javascript>
			var mebtnopenurl = 'http://game2.id87.com/';
			window.shareData = {
					"imgUrl": "./icon.png",
					"timeLineLink": "http://game2.id87.com/xiaoniaofeifei/",
					"tTitle": "小鸟飞飞飞-微资源娱乐小游戏",
					"tContent": "从前有一只鸟,飞着飞着就死了。"
			};
		document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
		    
		    WeixinJSBridge.on('menu:share:appmessage', function(argv) {
		        WeixinJSBridge.invoke('sendAppMessage', {
		            "img_url": window.shareData.imgUrl,
		            "link": window.shareData.timeLineLink,
		            "desc": window.shareData.tContent,
		            "title": window.shareData.tTitle
		        }, function(res) {
		        	document.location.href = mebtnopenurl;
		        })
		    });

		    WeixinJSBridge.on('menu:share:timeline', function(argv) {
		        WeixinJSBridge.invoke('shareTimeline', {
		            "img_url": window.shareData.imgUrl,
		            "img_width": "640",
		            "img_height": "640",
		            "link": window.shareData.timeLineLink,
		            "desc": window.shareData.tContent,
		            "title": window.shareData.tTitle
		        }, function(res) {
		        	document.location.href = mebtnopenurl;
		        });
		    });
		}, false);
		function dp_submitScore(a,b){
			if(a&&b>=a&&b>10){
				//alert("新纪录哦!你过了"+b+"关!")
				dp_share(b)
			}
		}
			
		function dp_Ranking(){
		    document.location.href = mebtnopenurl;
		}
		function dp_share(t){
			document.title = "我玩小鸟飞飞飞过了"+t+"关!你能超过洒家我吗?";
			document.getElementById("share").style.display="";
			window.shareData.tTitle = document.title;
		}
		</script>
		</head>
	<body>
		<div style="text-align:center;">
			<canvas id="linkScreen">
				很遗憾,您的浏览器不支持HTML5,请使用支持HTML5的浏览器。
			</canvas>
		</div>
        <div id="mask_container" align="center" style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; display: none; z-index: 100000; background-color: rgb(255, 255, 255);">
                <img id="p2l" src="img/p2l.jpg" style="position: absolute;left: 50%;top: 50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)" >
        </div>
		<div id=share style="display:none">
		<img  width=100% src="2000.png"  style="position:absolute;top:0;left:0;display:" onclick="document.getElementById('share').style.display='none';">
		</div>
		
<div style="display:none;">
这里加统计
</div>
	</body>
</html>
相关推荐
alansoulKing7 小时前
CS1.5 新手入门与联机部署全攻略
游戏·电脑·娱乐
tanghonghanhaoli8 小时前
【图书翻译】有意义的游戏设计:桌面游戏的方法论与心理学(第1、2章)
前端·游戏·ui
我是苏苏8 小时前
Steam游戏:如何回退到旧版本下载(技术帖)
游戏
糖醋_诗酒1 天前
游戏产品经理 - 蚂蚁外包 - 一面凉经
游戏·产品经理
yangmu32031 天前
龙胤立志传MOD生态深度解析与安装指南
游戏·游戏程序
辻弋2011 天前
一键优化电源计划、游戏模式、独显强制、禁用后台录制——DeltaForceBooster专治三角洲行动卡顿掉帧,所有改动可一键还原
服务器·数据库·windows·游戏·电脑·php
江上闲人.1 天前
COD23现代战争4试玩进不去报错?TPM2.0安全启动等常见问题解决方法
游戏·使命召唤·cod23·使命召唤现代战争4·cod
pearbing2 天前
游戏社群外包运营:一站式游戏玩家社区托管与生态搭建服务
游戏·游戏社群舆情监控·游戏社群管理外包·各行业社群外包运营
江上闲人.2 天前
Wardogs战犬\战狗Beta测试启动报错UE崩溃卡顿?解决方法来了
游戏·游戏引擎·虚幻·战犬·战狗·wardogs