-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
110 lines (97 loc) · 4.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<title>Laser Puzzle</title>
<!--<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1; user-scalable=0;"/>-->
<meta name="viewport" content="user-scalable=no, maximum-scale=1.0, width=device-width, height=device-height"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<style>
* { -webkit-tap-highlight-color:rgba(0,0,0,0); }
</style>
</head>
<body>
<script>
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
(function() {
var pcBaseUrl = 'playcraftjs/';
var pcVersion = '0.5.6';
var gameScriptBaseUrl = 'js/';
var gameMainClass = 'TheGame';
var gameEltId = 'pcGameCanvas';
var gameScripts = [
// add extra files here, e.g.
'utils.js',
'grid.js',
'levels.js',
'imagelayer.js',
'laserlayer.js',
'menulayer.js',
'doorlayer.js',
'pivotbacklayer.js',
'components/pivot.js',
'components/filter.js',
'systems/pivots.js',
'gamescene.js',
'spritesheet.js',
'game.js'];
var production = window.production = (document.location.hostname != "localhost" || navigator.isCocoonJS);
var mainScript = production ? pcBaseUrl+"dist/playcraft-"+pcVersion+".min.js" : pcBaseUrl+"lib/playcraft.js";
var head = document.getElementsByTagName("head")[0];
var scriptTag = document.createElement('script');
scriptTag.type = "text/javascript" ;
scriptTag.src = mainScript;
scriptTag.charset = 'utf-8';
scriptTag.onload = function() {
//pc.device.devMode = !production;
pc.start(gameEltId, gameMainClass, gameScriptBaseUrl, gameScripts, pcBaseUrl+'lib/');
};
scriptTag.onreadystatechange = function() {
if(this.readyState == 'complete') {
this.onload();
}
}
head.appendChild(scriptTag);
})();
</script>
<div style='position: absolute; width: 100%; height: 100%; padding:0; margin:0; left:0; top:0'>
<div id="center1" style='background-color: #000; height: 100%; width:100%'>
<canvas id="pcGameCanvas" screencanvas="true"></canvas>
</div>
</div>
<!--
<a href="https://github.com/dobesv/1gam-LaserPuzzle"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
-->
<script type="text/javascript">
if(!navigator.isCocoonJS) {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24340079-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
}
</script>
</body>
</html>