-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell-release.html
391 lines (351 loc) · 15.1 KB
/
shell-release.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<!doctype html>
<html lang="EN-us">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Qu-Ngx's Asteroids Game</title>
<meta name="title" content="raylib web game" />
<meta
name="description"
content="An C++ Asteroids game made by Quang D. Nguyen with Raylib"
/>
<meta
name="keywords"
content="raylib, html5, C, C++, library, games, videogames"
/>
<meta name="viewport" content="width=device-width" />
<!-- Open Graph metatags for sharing -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Qu-Ngx's Asteroids Game" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:alt" content="Qu-Ngx's Asteroids game" />
<meta property="og:image" content="https://linkedin.com/in/qu-ngx/" />
<meta property="og:site_name" content="raylib - example" />
<meta property="og:url" content="https://www.raylib.com/games.html" />
<meta property="og:description" content="Qu-Ngx's Asteroids Game" />
<!-- Favicon -->
<link
rel="shortcut icon"
href="https://private-user-images.githubusercontent.com/91497379/351521769-56d0fe30-8482-41de-9044-67df5ff3f997.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4NjExMTMsIm5iZiI6MTcyMTg2MDgxMywicGF0aCI6Ii85MTQ5NzM3OS8zNTE1MjE3NjktNTZkMGZlMzAtODQ4Mi00MWRlLTkwNDQtNjdkZjVmZjNmOTk3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI0VDIyNDAxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYyMDU2ZTBkZTJiMjExZWM0NzhkZmFmYzM2YTVkNDY1NDFkZTIwYmVmYjcwOTI0NzdlMWY0ZTFiNTZmZjczZDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.sRmrByw2Rm-qT7RThq-dg_ZkA0pJkVKjSB6_XiMpr6s"
/>
<style>
body {
font-family: arial;
margin: 0;
padding: none;
}
#header {
width: 100%;
height: 140px;
background-color: #44c0ff;
}
/* NOTE: raylib logo is embedded in the page as base64 png image */
#logo {
width: 105px;
height: 114px;
float: right;
position: relative;
margin-top: 15px;
margin-right: 20px;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGkAAAByCAMAAABnTQ9QAAAAXVBMVEVHcEwxaLwAAAAsZMMtXbEmSocAAAAqRoEWZcIAAAAtZsAxab0AAAAAAACjxOyixO0GTf8GTf8xaLsadN8AAAAHTP+nxO0beuwZctyaxOs0bsYQTJUEFSoZNVYMOGz+rc41AAAAEnRSTlMAz91dNRivBP/7nulWeXzQquQIpKiSAAAHaUlEQVRo3r2a2WKjOgxAaQJ1aZsuRg0Ekv7/Z453S7YMhpl7eUiTNPggWTs0oI6++T8OGIbhAbDvJHmUNAwTwHv9Oa/ymFCwGFi9XELOB/WnjlGhxlqUlE+HQJe7YvSaBbUg2R4iPS/D1AuAWtKsSIdAQpPA2AXUiiTFUZmc+VWDjpqeN3NRDZKHPXdYoN4a/oKkxKl2JU05bBFGbZe+rwTNgdQd8Fv1MtXECKs4S+p2W6D2I7hXGbnbIfu6360MyZrfhgJb60hz4O0UypEqYoQ08U44WfbbYDUp6k4Gcxf/BYmCjjhWJcntzptf3TmW/Pcku6gIGtOfn/ah6kjGZRskhfesHax+dLl9jYR2h8hoWec9IRbe10gS7w4hqeJlh1hgAlJfTht0d5r83U4bhG2R6PozupC91r4FKkiyjySKJKychORsYd5VlhVJGBT1JHCM2Ke+Eqklq8TNwSmxUn3gD5Yk0M43Oig8IT12/n+VpCEcOamTiUgheqPsmwp+hJS6Cvo0k9qlKoOIovb8rgsE6oh81BQPW4S+avnK23hMUOfdqIwkSX3i0HNZtdWolHQuhu/S0tUooJ1aOG32b4KBfXx8MCJaO91qrFSjpoN5w5HyN9frtSTjhliq95yUQDRp5IligyT9URZLFcrOnQQjk8y9kyVZixdrUtmUq9vcKd0ngYNnDK4syU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cYYbfv/ImfmzqYyN7HMQrQe0GOpDwAUBW2mWtuN0dCDq3fdyu3nILnNpS0Cvo0oA+/Y21EtfmNhQFrD1t5zSMCmmP+XG/YPBijjKQRONJmOWBQVoVnZIs5imybL7+ArcIKFqFJ3c3JFlmlgBUFNO2nIYm6+6UKIaxkgjhZBco8w+cNU+iZX997S40W68sEJwy2Z0Wgqgrzwlh3uQcFdZjy6y2jO8Dq1aezh44wVnmKBD4A2CVRolvABIe7SrjC/GpxKFimaQyPP/bYNJWxkIA8RKHwYPBE5oThaZ8BvJ17rZy0pt7z0aL5LUdqHMg5pfq2H9FJE/jL9X96P/F9h9H17kJH+gWHfo4kLAkuyqeM8QoYULEC4ZHKyX2tT7r8DpO9ArsbELOZnnAr0gsl2bU06fdxc2o0JEiDHtCZq3kkURmFf85S/fulx7cpT5QEL/r0Xy3vEknoUay4uqD1n5ZJyfECkaS7UQDvzohkUupkLcWSrrePboMkOJKwiys1duZW6IUhuQmxtn3TH1vBzYvLGQv+PRLq8jCkKZBMqeFejZfpM/W/eqIMJ7ufZCCLWPxujv65Srtv7w9DCSQj8jT5l8WalU4sd1sb8CRi5UNq5b/AkLCvWxngzg3vE1Liua6iUJc5hfM6tQ7Wngk6MUQIXAzg7ihOU907ZZSTOxboYJqszk1Na8KCviRXb3ozcTpGD567HXhOJ5BubAcXe6fbH2Cj8XtDI7SzECDj0fwxZnHsud54/AFflDkNV1C5ZAAAAABJRU5ErkJggg==");
}
.emscripten {
padding-right: 0;
margin-left: auto;
margin-right: auto;
display: block;
}
div.emscripten {
text-align: center;
}
div.emscripten_border {
border: 1px solid black;
}
/* NOTE: Canvas *must not* have any border or padding, or mouse coords will be wrong */
canvas.emscripten {
border: 0px none;
background: black;
width: 512;
height: 512;
}
.spinner {
height: 30px;
width: 30px;
margin: 0;
margin-top: 20px;
margin-left: 20px;
display: inline-block;
vertical-align: top;
-webkit-animation: rotation 0.8s linear infinite;
-moz-animation: rotation 0.8s linear infinite;
-o-animation: rotation 0.8s linear infinite;
animation: rotation 0.8s linear infinite;
border-left: 5px solid black;
border-right: 5px solid black;
border-bottom: 5px solid black;
border-top: 5px solid lightblue;
border-radius: 100%;
background-color: rgb(245, 245, 245);
}
@-webkit-keyframes rotation {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes rotation {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
@-o-keyframes rotation {
from {
-o-transform: rotate(0deg);
}
to {
-o-transform: rotate(360deg);
}
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#status {
display: inline-block;
vertical-align: top;
margin-top: 30px;
margin-left: 20px;
font-weight: bold;
color: rgb(40, 40, 40);
}
#progress {
height: 0px;
width: 0px;
}
#controls {
display: inline-block;
float: right;
vertical-align: top;
margin-top: 45px;
margin-right: 20px;
}
#output {
width: 100%;
height: 140px;
margin: 0 auto;
margin-top: 10px;
display: block;
background-color: black;
color: rgb(37, 174, 38);
font-family: "Lucida Console", Monaco, monospace;
outline: none;
}
input[type="button"] {
background-color: lightblue;
border: 4px solid darkblue;
color: black;
text-decoration: none;
cursor: pointer;
width: 140px;
height: 50px;
margin-left: 10px;
}
input[type="button"]:hover {
background-color: #f5f5f5ff;
border-color: lightblue;
}
</style>
</head>
<body>
<div id="header">
<a id="logo" href="https://linkedin.com/in/qu-ngx/" target="_blank"></a>
<div class="spinner" id="spinner"></div>
<div class="emscripten" id="status">Downloading...</div>
<span id="controls">
<span
><input
type="button"
value="🖵 FULLSCREEN"
onclick="Module.requestFullscreen(false, false)"
/></span>
<span
><input
type="button"
value="CODE & GAMEPLAY"
onclick=" window.open('https://github.com/qu-ngx/Asteroids','_blank')"
/></span>
<span
><input
type="button"
id="btn-audio"
value="ABOUT QU-NGX"
onclick=" window.open('https://linkedin.com/in/qu-ngx/','_blank')"
/></span>
</span>
<div class="emscripten">
<progress value="0" max="100" id="progress" hidden="1"></progress>
</div>
</div>
<div class="emscripten_border">
<canvas
class="emscripten"
id="canvas"
oncontextmenu="event.preventDefault()"
tabindex="-1"
></canvas>
</div>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"
></script>
<script type="text/javascript">
function saveFileFromMEMFSToDisk(memoryFSname, localFSname) {
// This can be called by C/C++ code
var isSafari = false; // Not supported, navigator.userAgent access is being restricted
//var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
var data = FS.readFile(memoryFSname);
var blob;
if (isSafari)
blob = new Blob([data.buffer], { type: "application/octet-stream" });
else
blob = new Blob([data.buffer], { type: "application/octet-binary" });
// NOTE: SaveAsDialog is a browser setting. For example, in Google Chrome,
// in Settings/Advanced/Downloads section you have a setting:
// 'Ask where to save each file before downloading' - which you can set true/false.
// If you enable this setting it would always ask you and bring the SaveAsDialog
saveAs(blob, localFSname);
}
</script>
<script type="text/javascript">
var statusElement = document.querySelector("#status");
var progressElement = document.querySelector("#progress");
var spinnerElement = document.querySelector("#spinner");
var Module = {
preRun: [],
postRun: [],
print: (function () {
var element = document.querySelector("#output");
if (element) element.value = ""; // Clear browser cache
return function (text) {
if (arguments.length > 1)
text = Array.prototype.slice.call(arguments).join(" ");
// These replacements are necessary if you render to raw HTML
//text = text.replace(/&/g, "&");
//text = text.replace(/</g, "<");
//text = text.replace(/>/g, ">");
//text = text.replace('\n', '<br>', 'g');
console.log(text);
if (element) {
element.value += text + "\n";
element.scrollTop = element.scrollHeight; // focus on bottom
}
};
})(),
printErr: function (text) {
if (arguments.length > 1)
text = Array.prototype.slice.call(arguments).join(" ");
console.error(text);
},
canvas: (function () {
var canvas = document.querySelector("#canvas");
// As a default initial behavior, pop up an alert when webgl context is lost.
// To make your application robust, you may want to override this behavior before shipping!
// See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
canvas.addEventListener(
"webglcontextlost",
function (e) {
alert("WebGL context lost. You will need to reload the page.");
e.preventDefault();
},
false,
);
return canvas;
})(),
setStatus: function (text) {
if (!Module.setStatus.last)
Module.setStatus.last = { time: Date.now(), text: "" };
if (text === Module.setStatus.last.text) return;
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Module.setStatus.last.time < 30) return; // If this is a progress update, skip it if too soon
Module.setStatus.last.time = now;
Module.setStatus.last.text = text;
if (m) {
text = m[1];
progressElement.value = parseInt(m[2]) * 100;
progressElement.max = parseInt(m[4]) * 100;
progressElement.hidden = true;
spinnerElement.hidden = false;
} else {
progressElement.value = null;
progressElement.max = null;
progressElement.hidden = true;
if (!text) spinnerElement.style.display = "none";
}
statusElement.innerHTML = text;
},
totalDependencies: 0,
monitorRunDependencies: function (left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(
left
? "Preparing... (" +
(this.totalDependencies - left) +
"/" +
this.totalDependencies +
")"
: "All downloads complete.",
);
},
//noInitialRun: true
};
Module.setStatus("Downloading...");
window.onerror = function () {
Module.setStatus("Exception thrown, see JavaScript console");
spinnerElement.style.display = "none";
Module.setStatus = function (text) {
if (text) Module.printErr("[post-exception status] " + text);
};
};
</script>
<!-- REF: https://developers.google.com/web/updates/2018/11/web-audio-autoplay -->
<script type="text/javascript">
var audioBtn = document.querySelector("#btn-audio");
// An array of all contexts to resume on the page
const audioContexList = [];
(function () {
// A proxy object to intercept AudioContexts and
// add them to the array for tracking and resuming later
self.AudioContext = new Proxy(self.AudioContext, {
construct(target, args) {
const result = new target(...args);
audioContexList.push(result);
if (result.state == "suspended") audioBtn.value = "🔈 RESUME";
return result;
},
});
})();
function toggleAudio() {
var resumed = false;
audioContexList.forEach((ctx) => {
if (ctx.state == "suspended") {
ctx.resume();
resumed = true;
} else if (ctx.state == "running") ctx.suspend();
});
if (resumed) audioBtn.value = "🔇 MUTE";
else audioBtn.value = "🔈 RESUME";
}
</script>
{{{ SCRIPT }}}
</body>
</html>