-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (50 loc) · 1.89 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
<html>
<head>
<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
<script type="application/javascript" src="lib/keymaster.js"></script>
<script type="application/javascript" src="lib/bundle.js"></script>
<script type="text/javascript">
function mute() {
const audios = document.getElementsByTagName('audio');
for (var i = 0; i < audios.length; i++) {
audios[i].volume = 0.0;
}
document.getElementById("mute").style.display = "none";
document.getElementById("unmute").style.display = "inline-block";
}
function unmute() {
const audios = document.getElementsByTagName('audio');
for (var i = 0; i < audios.length; i++) {
audios[i].volume = 1;
}
document.getElementById("unmute").style.display = "none";
document.getElementById("mute").style.display = "inline-block";
}
</script>
<link rel="stylesheet" href="blocks.css">
</head>
<body>
<div id="all-sounds">
<audio id="gameplay" src="assets/sounds/gameplay.mp3"></audio>
<audio id="enemy-damage" src="assets/sounds/enemydamage.wav"></audio>
<audio id="game-over" src="assets/sounds/gameOver.wav"></audio>
<audio id="intro-music" src="assets/sounds/intro.mp3"></audio>
<audio id="bullet" src="assets/sounds/bullet.wav"></audio>
</div>
<div style="display:none;">
<img id="char" src="assets/agent.png">
</div>
<canvas id="canvas" width="640" height="480">
Your browser doesn't support canvas.
</canvas>
<div class="bottom">
<button id="mute" onclick="mute();">Mute</button>
<button id="unmute" onclick="unmute();">Unmute</button>
<div class="bottom-container">
<div class="instructions">
<div>a - move left</div><div>d - move right</div><div>spacebar - fire</div>
</div>
</div>
</div>
</body>
</html>