index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="user-scalable=no"/>
  6. <title>摩天大楼</title>
  7. <link rel="icon" type="image/GIF" href="res/favicon.ico"/>
  8. <meta name="apple-mobile-web-app-capable" content="yes"/>
  9. <meta name="full-screen" content="yes"/>
  10. <meta name="screen-orientation" content="portrait"/>
  11. <meta name="x5-fullscreen" content="true"/>
  12. <meta name="360-fullscreen" content="true"/>
  13. <style>
  14. body, canvas, div {
  15. -moz-user-select: none;
  16. -webkit-user-select: none;
  17. -ms-user-select: none;
  18. -khtml-user-select: none;
  19. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  20. }
  21. </style>
  22. </head>
  23. <body style="padding:0; margin: 0; background: #000;">
  24. <canvas id="gameCanvas" width="320" height="480"></canvas>
  25. <script>
  26. var wx = {}, cc = {};
  27. cc.OrbitCamera = cc.CatmullRomBy = cc.CatmullRomTo = cc.CardinalSplineBy = cc.CardinalSplineTo = {};
  28. </script>
  29. <script src="src/engine.js"></script>
  30. <script src="src/game.min.js"></script>
  31. <script language=javascript>
  32. var mebtnopenurl = 'http://game.ikongzhong.cn';
  33. window.shareData = {
  34. "imgUrl": "http://game.ikongzhong.cn/icon/mtl.png",
  35. "timeLineLink": "http://game.ikongzhong.cn/games/mtl/",
  36. "tTitle": "摩天楼",
  37. "tContent": "摩天楼"
  38. };
  39. function goHome(){
  40. window.location=mebtnopenurl;
  41. }
  42. function clickMore(){
  43. if((window.location+"").indexOf("zf",1)>0){
  44. window.location = "http://game.ikongzhong.cn";
  45. }
  46. else{
  47. goHome();
  48. }
  49. }
  50. function dp_share(){
  51. document.title ="在摩天楼时,我竟然突破了"+myData.score+"层,谁敢跟我一比?";
  52. document.getElementById("share").style.display="";
  53. window.shareData.tTitle = document.title;
  54. }
  55. function dp_Ranking(){
  56. window.location=mebtnopenurl;
  57. }
  58. function showAd(){
  59. }
  60. function hideAd(){
  61. }
  62. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  63. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  64. WeixinJSBridge.invoke('sendAppMessage', {
  65. "img_url": window.shareData.imgUrl,
  66. "link": window.shareData.timeLineLink,
  67. "desc": window.shareData.tContent,
  68. "title": window.shareData.tTitle
  69. }, onShareComplete);
  70. });
  71. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  72. WeixinJSBridge.invoke('shareTimeline', {
  73. "img_url": window.shareData.imgUrl,
  74. "img_width": "640",
  75. "img_height": "640",
  76. "link": window.shareData.timeLineLink,
  77. "desc": window.shareData.tContent,
  78. "title": window.shareData.tTitle
  79. }, onShareComplete);
  80. });
  81. }, false);
  82. </script>
  83. <div id=share style="display: none">
  84. <img width=100% src="share.png"
  85. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  86. ontouchstart="document.getElementById('share').style.display='none';" />
  87. </div>
  88. <div style="display: none;">
  89. <script type="text/javascript">
  90. var myData = { gameid: "mtl" };
  91. var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
  92. //window.shareData.timeLineLink = "http://"+ parseInt(Math.random()*100000) +"."+ myData.gameid +"."+domain+"/gamecenter.html?gameid=" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
  93. function dp_submitScore(score){
  94. myData.score = score;
  95. myData.scoreName = score+"层";
  96. if(score>0){
  97. if (confirm("你盖了"+score+"层摩天楼,真是了不起啊!")){
  98. dp_share();
  99. }
  100. }
  101. }
  102. function onShareComplete(res) {
  103. if (localStorage.myuid && myData.score != undefined) {
  104. setTimeout(function(){
  105. if (confirm("要将成绩提交到空中传媒排行榜吗?")) {
  106. // window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  107. }
  108. else {
  109. document.location.href = mebtnopenurl;
  110. }
  111. }, 500);
  112. }
  113. else {
  114. document.location.href = mebtnopenurl;
  115. }
  116. }
  117. </script>
  118. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=36313548" charset="UTF-8"></script></body>
  119. </html>