-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
121 lines (117 loc) · 3.48 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
<!doctype html>
<head>
<meta charset="utf-8">
<title>Corre Forest</title>
<style type="text/css" media="screen">
body{
background-color:lightgray;
}
#correforest .menu{
color: #FFF;
padding: 3px;
background:#000;
font-size:14px;
font-family:arial;
}
#correforest .menu .speed{
float:left;
margin-left:10px;
color:#FFFF55;
width:220px;
}
#correforest .menu .lives{
float:right;
color:#FF0000;
width:100px;
text-align:right;
}
#correforest .menu .counter{
text-align: center;
}
#correforest .display{
z-index: 10;
text-align: center;
position: absolute;
top: 45%;
left: 42%;
background: #000;
color: #FFF;
padding: 10px;
opacity: 0.7;
}
#correforest canvas{
clear:both;
}
</style>
<script src="correforest.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
function getDocHeight() {
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
var CorreForestConfig = {
// Container
wrapper: 'correforest',
// Keys Codes
keys: {left : 37, down: 40, right: 39, up: 38, pause: 32},
// Player position
position: {x: 'middle', y : 4},
// Speed and lives
speed: {max: 18, min: 4},
lives: 4,
// Road width (pixels)
road: 100,
// Colors
colors : {
trees: '#103406',
road: '#15581a',
player: {outside: '#6E440B', inside: '#3E2608'}
},
strings: {
start: '<strong>New game</strong><br/>Press <space> to start',
pause: '<strong>Paused</strong><br/>Press <space> to continue',
gameover: '<strong>Gameover</strong><br/>Press <space> to restart'
},
// Start playing onload
autoplay: false
};
window.onload = function(){
CorreForestConfig.height = getDocHeight() - document.body.offsetHeight - 75;
CorreForestConfig.width = window.innerWidth - 16;
corre = new CorreForest(CorreForestConfig);
}
</script>
</head>
<body>
<!-- wrapper -->
<div style="" id="correforest"></div>
<audio loop="loop" >
<source src="piratesplunge.ogg" type="audio/ogg" media="all">
<source src="piratesplunge_128.mp3" type="audio/mp3" media="all">
</audio>
<audio>
<!-- Firefox doesn't play mp3, and blackberry doesn't play ogg -->
<source src="punch_or_whack.ogg" type="audio/ogg" media="all">
<source src="punch_or_whack.mp3" type="audio/mp3" media="all">
</audio>
<div style="text-align:center; font-style: italic; clear:both">
Original idea from: <a href="http://www.lsi.upc.edu/~jalonso/vj/">http://www.lsi.upc.edu/~jalonso/vj/</a><br/>
<small>Music by http://wrathgames.com/blog [WrathGames Studio]</small>
</div>
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
</body>
<script type="text/javascript">//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount','UA-25715218-1']);
_gaq.push(['_trackPageview'],['_trackPageLoadTime']);
(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>