-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (78 loc) · 2.57 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
<!DOCTYPE html>
<html>
<head>
<style>
html, body { margin: 0; padding: 0; }
</style>
<script src="js/polyfill.js"></script>
<script src="js/key.js"></script>
<script src="js/game.js"></script>
<script src="js/sounds.js"></script>
<script src="js/scoreboard.js"></script>
<script src="js/ball.js"></script>
<script src="js/bat.js"></script>
<script src="js/rect.js"></script>
</head>
<body>
<audio id="batHit">
<source src="media/bat-hit.mp3" type="audio/mp3" />
<source src="media/bat-hit.wav" type="audio/wave" />
</audio>
<svg id="game" viewBox="0 0 700 500" style="position: absolute; height: 100%; width: 100%">
<style>
#backdrop {
fill: black;
}
#net rect {
fill: white;
}
.bat {
fill: white;
}
#ball {
fill: white;
}
text {
font-family: sans-serif;
font-size: 32px;
text-align: right;
fill: white;
}
</style>
<rect id="backdrop" x="0" y="0" width="700" height="500" />
<g id="net">
<rect x="345" y="10" width="10" height="10" />
<rect x="345" y="30" width="10" height="10" />
<rect x="345" y="50" width="10" height="10" />
<rect x="345" y="70" width="10" height="10" />
<rect x="345" y="90" width="10" height="10" />
<rect x="345" y="110" width="10" height="10" />
<rect x="345" y="130" width="10" height="10" />
<rect x="345" y="150" width="10" height="10" />
<rect x="345" y="170" width="10" height="10" />
<rect x="345" y="190" width="10" height="10" />
<rect x="345" y="210" width="10" height="10" />
<rect x="345" y="230" width="10" height="10" />
<rect x="345" y="250" width="10" height="10" />
<rect x="345" y="270" width="10" height="10" />
<rect x="345" y="290" width="10" height="10" />
<rect x="345" y="310" width="10" height="10" />
<rect x="345" y="330" width="10" height="10" />
<rect x="345" y="350" width="10" height="10" />
<rect x="345" y="370" width="10" height="10" />
<rect x="345" y="390" width="10" height="10" />
<rect x="345" y="410" width="10" height="10" />
<rect x="345" y="430" width="10" height="10" />
<rect x="345" y="450" width="10" height="10" />
<rect x="345" y="470" width="10" height="10" />
<rect x="345" y="490" width="10" height="10" />
</g>
<rect id="bat1" class="bat" x="10" y="10" width="10" height="50" />
<rect id="bat2" class="bat" x="680" y="10" width="10" height="50" />
<rect id="ball" x="100" y="245" width="10" height="10" />
</svg>
<script>
new Pong().initialise();
</script>
</body>
</html>