-
Notifications
You must be signed in to change notification settings - Fork 162
/
index.html
222 lines (197 loc) · 9.99 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Earth Guardian Game by Pujan-sarkar -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Earth Guardian</title>
<link rel="stylesheet" href="./static/styles/main.css">
<link rel="stylesheet" href="./static/styles/fonts.css">
<link rel="stylesheet" href="./static/styles/animations.css">
</head>
<body>
<!-- MAIN MENU CONTAINER -->
<div class="main-menu">
<!-- Title -->
<div class="title">
<h1 id="title">EARTH GUARDIAN</h1>
<!-- Start game button -->
<button id="startGame" class="mainButtons main-menu_buttons">Start game</button>
<button id="highscoreList" class="mainButtons main-menu_buttons">High scores</button>
<button id="about" class="mainButtons main-menu_buttons">About</button>
<!-- Github link -->
<a href="https://github.com/Pujan-sarkar" target="_blank"><img src="./assets/images/github.png" alt="Github" width="32x" height="32px"></a>
<!-- SOUND CONTROL -->
<img class="soundControl" src="./assets/images/soundOn.png" alt="" width="16px" height="16px">
<p id="copyright">© 2024</p>
<!-- About menu -->
<div class="aboutMenu">
<h3>ABOUT</h3>
<p>Remake of the classic Space Shooter type of games, with minor additions. All the assets used to create this game were free, provided by: <a href="https://jonathan-so.itch.io/" target="_blank">Jonathan So</a>, <a href="https://kenney.nl/" target="_blank">Kenny</a>, and Google(still free !). This was a learning project, hope you like it. Have fun !</p>
<button id="closeAbout" class="main-menu_buttons mainButtons">Close</button>
</div>
<!-- Highscores menu -->
<div class="highscoresList-menu">
<h3>HIGHSCORES</h3>
<p id="noHighscores">No highscores... go set one!</p>
<button id="clearList" class="main-menu_buttons mainButtons">Clear</button>
<ol id="theList"></ol>
<button id="closeHighscores" class="main-menu_buttons mainButtons">Close</button>
</div>
</div>
</div>
<!-- LOADING PART -->
<div class="loading">
<p class="loading-text">0%</p>
<div class="loading-bar">
<div class="loading-bar_fill"></div>
</div>
<!-- COMMANDS INFO -->
<div class="info">
<h2>COMMANDS:</h2>
<p>Use arrow keys to move the ship !</p>
<p>Press spacebar to shoot !</p>
<p>Hold shift key to use booster!</p>
</div>
</div>
<!-- CANVAS -->
<div class="container">
<!-- INFO MENU - SCORE, TIMER, HP... -->
<div class="menu">
<p id="pauseGame" class="main-menu_buttons">MENU</p>
<div class="time"><p id="timerDisplay">0:30</p></div>
<div class="level-container">
<p id="levelText">Level: <span id="currentLevel">1</span></p>
<div class="level-bar">
<p><span id="currentExp">0</span>/<span id="requiredExp">80 XP</span></p>
<div class="level-bar_fill"></div>
</div>
</div>
<div class="textContainer">
<p class="killCount">KILLS: <span id="killCount">0</span></p>
</div>
</div>
<!-- HEALTH CONTAINER -->
<div class="health-container">
<img src="assets/images/firstAid.png" alt="" width="32px" height="32px">
<div class="containerText">
<p id="healthText">100%</p>
</div>
</div>
<!-- SHIP SHIELD CONTAINER -->
<div class="shield-container">
<img src="assets/images/shieldImage.png" alt="" width="32px" height="32px">
<div class="containerText">
<p id="shieldText">100%</p>
</div>
</div>
<!-- COUNTDOWN TEXT -->
<div class="countdown"></div>
<!-- WARNING / NEW HIGHSCORE TEXT -->
<div class="emptyWarning-text"></div>
<!-- OVERHEATING BAR -->
<div class="overheat-container">
<p>OVERHEAT: </p>
<div class="overheat-bar">
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
<div class="overheat-bar_block"></div>
</div>
</div>
<!-- GAME FINISHED / GAME OVER MENU -->
<div class="game--over">
<img id="displayImage" src="./assets/images/tombstone.png" alt="Tombstone" width="70px" height="70px">
<p id="message">Thank you for your service.</p>
<!-- NEW HIGHSCORE PLAYER NAME ENTER -->
<div class="newHighscore-input">
<h2 id="scoreText"></h2>
<input type="text" id="playerName-input" placeholder="Enter your name..." required>
<button id="savePlayer" class="main-menu_buttons gameOverBtn">SAVE</button>
</div>
<div class="scores">
<p>Total kills: <span id="totalKills"></span></p>
<p>Time played multiplier: <span id="multiplier"></span></p>
<p>Final score: <span id="finalScore"></span></p>
<p>Current Highscore: <span id="highscore"></span></p>
</div>
<button class="main-menu_buttons gameOverBtn" id="restartGame">RESTART</button>
<button class="exitGame gameOverBtn main-menu_buttons">EXIT</button>
</div>
<!-- PAUSE MENU -->
<div class="pause--menu">
<h3>GAME PAUSED</h3>
<p id="continueGame" class="main-menu_buttons">CONTINUE</p>
<p id="settings" class="main-menu_buttons">SETTINGS</p>
<p class="exitGame main-menu_buttons">QUIT</p>
</div>
<!-- SETTINGS MENU(WINDOW) -->
<div class="settings-menu">
<h2>SETTINGS</h2>
<div class="settings-volumeControls">
<h3>VOLUME CONTROLS:</h3>
<!-- CONTROL BACKGROUND MUSIC VOLUME -->
<div class="settings-music">
<label for="musicVolume">Music volume: <span class="displayChange" id="bgMusic">20%</span></label>
<input type="range" id="musicVolume" min="0" max="100" value="20" step="1" name="bgMusic">
</div>
<!-- CONTROL SFX VOLUME -->
<div class="settings-sfx">
<label for="sfxVolume">SFX volume: <span class="displayChange" id="sfx">30%</span></label>
<input type="range" id="sfxVolume" min="0" max="100" value="30" step="1" name="sfx">
</div>
</div>
<!-- SHIP COMMANDS -->
<div class="ship-commands">
<h3>SHIP COMMANDS:</h3>
<div class="directionControl">
<!-- LEFT -->
<label for="shipLeft">Left: <span class="displayCommand" id="left">ArrowLeft</span></label>
<input type="text" id="shipLeft" name="left" maxlength="1" value="ArrowLeft" spellcheck="false">
</div>
<div class="directionControl">
<!-- RIGHT -->
<label for="shipRight">Right: <span class="displayCommand" id="right">ArrowRight</span></label>
<input type="text" id="shipRight" name="right" maxlength="1" value="ArrowRight" spellcheck="false">
</div>
<div class="directionControl">
<!-- UP -->
<label for="shipUp">Up: <span class="displayCommand" id="up">ArrowUp</span></label>
<input type="text" id="shipUp" name="up" maxlength="1" value="ArrowUp" spellcheck="false">
</div>
<div class="directionControl">
<!-- DOWN -->
<label for="shipDown">Down: <span class="displayCommand" id="down">ArrowDown</span></label>
<input type="text" id="shipDown" name="down" maxlength="1" value="ArrowDown" spellcheck="false">
</div>
<div class="directionControl">
<!-- SHOOTING -->
<label for="playerShooting">Shoot: <span class="displayCommand" id="shooting">Space</span></label>
<input type="text" id="playerShooting" name="shooting" maxlength="1" value="Space" spellcheck="false">
</div>
<div class="directionControl">
<!-- BOOSTER -->
<label for="booster">Boost: <span class="displayCommand" id="useBooster">Shift</span></label>
<input type="text" id="booster" name="useBooster" maxlength="1" value="Shift" spellcheck="false">
</div>
</div>
<span class="muteContainer">MUTE: <img class="soundControl" src="./assets/images/soundOn.png" title="Mute / Unmute all sounds." alt="" width="16px" height="16px"></span>
<button id="goBack">BACK</button>
</div>
<!-- GAME WINDOW -->
<canvas id="canvas" width="1280px" height="500px"></canvas>
<!-- NOTIFICATIONS -->
<div class="notificationsContainer">
<div class="notification"></div>
</div>
</div>
<!-- Script link -->
<script type="module" src="./static/js/main.js"></script>
</body>
</html>