-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
79 lines (69 loc) · 2.5 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
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Ballarena Revival</title>
<meta charset="utf-8">
<style type="text/css">
html,body {
height:100%;
}
div {
float: left;
width: 100%;
min-height:100%;
height:100%;
margin: 0px;
background-color : black;
}
table {
width:100%;
height:100%;
}
canvas {
position:absolute;
z-index=-1;
}
</style>
</head>
<body>
<div id="d">
<canvas id="c"></canvas>
<table>
<tr><td id="e"></td><td id="f"></td><td id="g"></td></tr>
</table>
</div>
<script language="Javascript" src="advancedRenderer.js"></script>
<script language="Javascript" src="ball.js"></script>
<script language="Javascript" src="basicRenderer.js"></script>
<script language="Javascript" src="brick.js"></script>
<script language="Javascript" src="brickPath.js"></script>
<script language="Javascript" src="collisionHandler.js"></script>
<script language="Javascript" src="controls.js"></script>
<script language="Javascript" src="floater.js"></script>
<script language="Javascript" src="game.js"></script>
<script language="Javascript" src="level.js"></script>
<script language="Javascript" src="menuDriver.js"></script>
<script language="Javascript" src="player.js"></script>
<script language="Javascript" src="soundManager.js"></script>
<script>
var b = document.body;
var c = document.getElementsByTagName('canvas')[0];
document.body.clientWidth; // fix bug in webkit: http://qfox.nl/weblog/218
window.onload = function() {
var controls = new Controls();
document.onkeydown = function(event) { return controls.onKeyDown(event); }
document.onkeyup = function(event) { return controls.onKeyUp(event); }
document.getElementById("e").onmousedown = function(event) { return controls.mouseControl(event, 8, true); }
document.getElementById("e").onmouseup = function(event) { return controls.mouseControl(event, 8, false); }
document.getElementById("g").onmousedown = function(event) { return controls.mouseControl(event, 9, true); }
document.getElementById("g").onmouseup = function(event) { return controls.mouseControl(event, 9, false); }
document.getElementById("c").onmousedown = function(event) {return controls.mouseControl(event, 0, true); }
var soundManager = new SoundManager();
var game = new Game(controls, soundManager);
var renderer = new AdvancedRenderer (c, b, game);
renderer.initialize();
game.setRenderer (renderer);
soundManager.initialize(c.getContext("2d"), game);
}
</script>
</body></html>