-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (36 loc) · 1.04 KB
/
Copy pathindex.html
File metadata and controls
43 lines (36 loc) · 1.04 KB
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
<!doctype html>
<html lang="en">
<head>
<title>String Theory</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="css/main.css">
<link rel="shortcut icon" type="image/png" href="favicon.png"/>
<script src="src/GameConfig.js"></script>
<script src="src/game.js" type="module"></script>
<!-- 3rd party libs -->
<script src="src/framework/phaser.3.80.min.js"></script>
<!--<script src="src/framework/three.min.js"></script>-->
<script src="src/manager/helpers.js"></script>
<script >
window.onbeforeunload = function (e) {
try {
const gameScene = window.game?.scene?.scenes[0];
if (gameScene && gameScene.saveGame) {
gameScene.saveGame();
}
} catch (error) {
console.log("Could not save on close:", error);
}
e = e || window.event;
if (e) {
e.returnValue = '?';
}
return '?';
};
</script>
</head>
<body>
<div id="gameDiv"></div>
</body>
</html>