圣诞节寻找圣诞老人小游戏源代码,上传即可使用
圣诞节快到了,提前祝大家节日快乐,在这也给打击分享个应景的寻找圣诞老人小游戏的源码
来自图灵机器人官方微社区的分享,是一个比拼记忆力,寻找圣诞老人的html5小游戏,直接下载源码,上传至服务器就能够使用,游戏操作简单,但是有一定的难度,体验不错。体验地址:http://182.92.67.78/game2/index.html
这个部分是游戏的主页面代码,源代码已上传,下载上传至自己服务器即可使用
<
html
>
<!--图灵机器人圣诞节小游戏-->
<!--下载源文件上传至服务器即可使用,无需修改任何内容-->
<
head
>
<
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"
/>
<
style
>
body {
text-align: center;
background: #00b7ee;
padding: 0;
border: 0;
margin: 0;
height: 100%;
}
html {
-ms-touch-action: none; /* Direct all pointer events to JavaScript code. */
}
</
style
>
</
head
>
<
body
onload
=
"load()"
>
<
div
style
=
"display:inline-block;width:100%; height:100%;margin: 0 auto; background: #00b7ee; position:relative;"
id
=
"gameDiv"
>
<
canvas
id
=
"gameCanvas"
width
=
"480"
height
=
"800"
style
=
"background-color: #00b7ee"
></
canvas
>
</
div
>
<
script
>var document_class = "MyTest";</
script
>
<!--这部分内容在编译时会被替换,要修改文档类,请到工程目录下的egretProperties.json内编辑。-->
<
script
src
=
"js/jquery-1.7.2.min.js"
></
script
>
<
script
src
=
"js/egret_loader.js"
></
script
>
<
script
src
=
"js/game-min.js"
></
script
>
<
script
>
egret_h5.startGame();
</
script
>
<
script
language
=
javascript
>
function load(){
$.getJSON("http://test.tuling123.com/game2/gameSecond.do",{
name: ‘game2‘ //参数,
},function(json){
});
}
var mebtnopenurl = ‘http://test.tuling123.com/game2/‘;
window.shareData = {
"imgUrl": "http://test.tuling123.com/game2/icon.png",
"timeLineLink": "http://test.tuling123.com/game2/",
"tTitle": "寻找圣诞老人",
"tContent": "寻找圣诞老人"
};
function goHome(){
window.location=mebtnopenurl;
}
function clickMore(){
if((window.location+"").indexOf("zf",1)>0){
window.location = "http://182.92.67.78/game2/";
}
else{
goHome();
}
}
function dp_share(){
document.title =myData.desc;
document.getElementById("share").style.display="";
window.shareData.tTitle = document.title;
}
function dp_Ranking(){
window.location=mebtnopenurl;
}
function showAd(){
}
function hideAd(){
}
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
}, onShareComplete);
});
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
}, onShareComplete);
});
}, false);
</
script
>
<
div
id
=
share
style
=
"display: none"
>
<
img
width
=
100
%
src
=
"share.png"
style
=
"position: fixed; z-index: 9999; top: 0; left: 0; display: "
ontouchstart
=
"document.getElementById(‘share‘).style.display=‘none‘;"
/>
</
div
>
<
div
style
=
"display: none;"
>
<
script
type
=
"text/javascript"
>
var myData = { gameid: "jyds" };
// var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
//window.shareData.timeLineLink = "http://"+ parseInt(Math.random()*100000) +"."+ myData.gameid +"."+domain+"/gamecenter.html?gameid=" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
function dp_submitScore(score,desc){
myData.score = parseInt(score);
myData.desc=desc;
myData.scoreName = score+"关";
if(score>0){
if (confirm("好厉害呀,竟然闯过了"+score+"关,让小伙伴也来试试吧!")){
setTimeout(dp_share,500);
}
}
}
function onShareComplete(res) {
if (localStorage.myuid && myData.score != undefined) {
setTimeout(function(){
if (confirm("要将成绩提交到9G游戏排行榜吗?")) {
//window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
}
else {
document.location.href = mebtnopenurl;
}
}, 500);
}
else {
document.location.href = mebtnopenurl;
}
}
</
script
>
</
body
>
</
html
>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。