-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
144 lines (131 loc) · 4.47 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html>
<html>
<head>
<title>Impact Game</title>
<meta name="viewport" content="user-scalable=no,width=device-width" />
<style type="text/css">
html,body {
background-color: #000;
color: #fff;
font-family: helvetica, arial, sans-serif;
margin: 0;
padding: 0;
font-size: 12pt;
}
#overlay {
position: absolute;
width: 100%;
height: 320px;
}
#container {
width:100%;
height:100%;
}
#canvas {
width: 100%;
max-width: 400px;
margin: 0 auto;
border: 1px solid #555;
}
.button {
width: 117px;
display: inline-block;
text-align: center;
position: absolute;
}
#buttons {
display: none;
}
#downButton {
top: 80px;
right: 40px;
-moz-transform:rotate(90deg);
-webkit-transform:rotate(90deg);
-ms-transform:rotate(90deg);
-o-transform:rotate(90deg);
}
#upButton {
top: 10px;
right: 40px;
-moz-transform:rotate(270deg);
-webkit-transform:rotate(270deg);
-ms-transform:rotate(270deg);
-o-transform:rotate(270deg);
}
#leftButton {
top: 45px;
right: 75px;
-moz-transform:rotate(180deg);
-webkit-transform:rotate(180deg);
-ms-transform:rotate(180deg);
-o-transform:rotate(180deg);
}
#rightButton {
top: 45px;
right: 5px;
}
</style>
<!-- <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script> -->
<script type="text/javascript" src="lib/impact/impact.js"></script>
<script type="text/javascript" src="lib/game/main.js"></script>
<script type="text/javascript" src="lib/soundmanager/soundmanager2-nodebug-jsmin.js"></script>
<script type="text/javascript">
soundManager.url = 'lib/soundmanager/swf/';
soundManager.audioFormats = {
'mp3': {
'type': ['audio/mpeg; codecs="mp3"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],
'required': false
},
'mp4': {
'related': ['aac','m4a'], // additional formats under the MP4 container
'type': ['audio/mp4; codecs="mp4a.40.2"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],
'required': false
},
'ogg': {
'type': ['audio/ogg; codecs=vorbis'],
'required': false
},
'wav': {
'type': ['audio/wav; codecs="1"', 'audio/wav', 'audio/wave', 'audio/x-wav'],
'required': false
}
};
soundManager.onready(function(oStatus) {
if (!oStatus.success) {
return false;
}
if (soundManager.canPlayMIME('audio/ogg')) {
soundManager.fileEnding = 'ogg';
} else {
soundManager.fileEnding = 'mp3';
}
soundManager.blank = soundManager.createSound({
id: 'startSound',
url: 'media/blank.' + soundManager.fileEnding
});
});
touchMove = function(event) {
// Prevent scrolling on this element
event.preventDefault();
}
resizeOverlay = function() {
// resize overlay
var overlay = document.getElementById('overlay'),
canvas = document.getElementById('canvas');
overlay.style.height = canvas.offsetHeight + 'px';
}
</script>
</head>
<body onload="resizeOverlay()" onresize="resizeOverlay()">
<div id="container" ontouchmove="touchMove(event);">
<div id="overlay" onclick="if(StartScreen && StartScreen.start){soundManager.blank.play();StartScreen.start();}"></div>
<canvas id="canvas"></canvas>
<div id="buttons">
<div id="upButton" class="button"><img src="media/arrow.png"/></div>
<div id="downButton" class="button"><img src="media/arrow.png"/></div>
<div id="leftButton" class="button"><img src="media/arrow.png"/></div>
<div id="rightButton" class="button"><img src="media/arrow.png"/></div>
</div>
</div>
</body>
</html>