-
Notifications
You must be signed in to change notification settings - Fork 0
/
spaceinvaders.html
118 lines (94 loc) · 3.82 KB
/
spaceinvaders.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Space Invaders JS</title>
<!--Main style sheet -->
<link href="css/style.css" rel="stylesheet" />
<!--Social Media Icons-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!--Add favicon-->
<link rel="icon" href="game-spaceinvaders/favicon.ico" type="image/x-icon" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- The footer.js external file uses document.write() to create a footer -->
<!-- It can then be included across multiple pages and edited once for consistency -->
<script src="scripts/footer.js"></script>
</head>
<body>
<!--Anchor to return to top of page from bottom-->
<a id="topofpage"></a>
<div class="menu stretch">
<div id="menu" class="center"></div><!-- menu.js: displays the menu here -->
<script src="scripts/menu.js"></script>
</div>
<div class="heading">
<h1>Space Invaders JS</h1>
</div>
<div class="body-border">
<canvas id="aliensCanvas" class="" width="1280" height="720">Your browser does not support the HTML5
canvas tag.</canvas>
</div>
<!--Space Inavders game script-->
<script src="game-spaceinvaders/spaceinvaders.js"></script>
<!--Game Settings Panel-->
<div class="body-border control-panel">
<h2 id="trackTitleID">Current Track: 1</h2>
<div class="center">
<button id="muteID" onclick="muteAudio()" class="cancelbtn" title="Turn Game Effects On/Off">FX Off</button>
<button id="backID" onclick="skipBackwards()" title="Skip Track Backwards"><<</button>
<button id="rewindID" onclick="rewindTrack()" title="Rewind 5 Seconds"><</button>
<button id="playID" onclick="playMusic()" title="Play/Pause Current Track">Play Music</button>
<button id="fastforwardID" onclick="fastForwardTrack()" title="Fast Forward 5 Seconds">></button>
<button id="forwardID" onclick="skipForwards()" title="Skip Track Forwards">>></button>
<button id="randomID" onclick="playRandomMusic()" title="Play A Random Music Track">Random Track</button>
</div>
<script src="scripts/game-buttons.js"></script>
<!--Script for handling background music controls-->
<script src="scripts/music.js"></script>
</div>
<div class="body-border">
<button class="accordion">Current Top Score: <span id="scoreID"></span></button>
<div class="panel">
<h2>Top Scores</h2>
<p id="allScoresID"></p>
</div>
<button class="accordion">Controls</button>
<div class="panel">
<ul>
<li><b>Fire:</b>Spacebar</li>
<li><b>Move Left:</b>← Left Arrow</li>
<li><b>Move Right:</b>↓ Right Arrow</li>
</ul>
</div>
<button class="accordion">Info</button>
<div class="panel">
<h2>How To Play</h2>
<ul>
<li>Shoot the aliens</li>
<li>The less there is, the faster they move</li>
<li>Shoot the mothership for bonus points</li>
<li>They don't shoot back yet, I haven't that much time on my hands</li>
<li>Simples</li>
</ul>
<h2>About</h2>
<p>
Space Invaders is a 1978 arcade game created by Tomoshiro Nishikado.
</p>
</div>
<script src="scripts/accordion.js"></script>
<!--Get the stored high score and display it-->
<script>
document.getElementById("scoreID").innerHTML = parseInt(localStorage.getItem("spaceinvaders-highscore")) || 0;
</script>
<div class="backtotop">
<p><a href="#topofpage" title="Scroll back to top of this page">Back To Top</a></p>
</div>
</div>
<!-- The createFooter() function is called from the external footer.js file included in the head tag -->
<!-- It takes a class name parameter, the index page footer is fixed to the bottom of the screen -->
<!-- All other pages are not fixed, and have different formatting -->
<script>createFooter("regular-footer")</script>
</body>
</html>