-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.html
77 lines (74 loc) · 3.47 KB
/
game.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Your Game Name</title>
<style>
#loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
color: white;
font-size: 2em;
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
</style>
</head>
<body>
<div id="loading-overlay">Loading...</div>
<div id="game-container">
<canvas id="canvas" tabindex="1"></canvas>
<div id="overlay"></div>
<div id="buttons-overlay"></div>
</div>
<script>
const contentPath = '/content/';
window.myGame = {
contentPath: contentPath,
paths: {
// standard web app
assetsPaths: [contentPath + 'game.zip'], // change this to your game (you can specify multiple .zip files for consecutive overwriting patches)
'OpenBOR.zip': contentPath + 'OpenBOR.zip', // OpenBOR engine WASM port
'game.css': contentPath + 'game.css',
'main.js': contentPath + 'main.js',
'mobile.js': contentPath + 'mobile.js',
'buttons.zip': contentPath + 'buttons.zip',
'fflate.min.js': contentPath + 'fflate.min.js',
'nipplejs.min.js': contentPath + 'nipplejs.min.js',
// Doginals - comment the above paths and uncomment the doginal IDs instead:
// assetsPaths: [contentPath + '77b3df2f4b3514f799c2a45f75bd4c0d4c6ba93441777c1aa5d346a948bee47ci0'],
// 'OpenBOR.zip': contentPath + 'c0d8e66efa1a2e53495b11d60fc4e1b65374d940b8fbcadf48609a19380b95a1i0',
// 'game.css': contentPath + '127b14b6f92648ad642997b8fbcf540880b0b40ec7769d36cd024ee6e78d390ai0',
// 'main.js': contentPath + 'a83e0b17e14157d6c66b80e714fcf3899170a7f9d3162cfc678d01736fcb74c0i0',
// 'mobile.js': contentPath + 'a68d57fd341f69d3d6f305a9ebe11e2df14e462e784b4418a16ec0a9a59064fdi0',
// 'buttons.zip': contentPath + '6bd4c55a8bfbbd8d3e5874df6c07770847e4b754db370644702207fb8cc086b2i0',
// 'fflate.min.js': contentPath + '7ad4ed7534dc9e6865ba74890c03507c8c3efe56bc41ba219146ad91bcc0f03di0',
// 'nipplejs.min.js': contentPath + 'e59aec9d79599d970f5ce33a9e39d491e0f8505c65ff87a0ed8b777737c7e7a9i0',
},
assetType: 'zip',
baseWidth: 320,
baseHeight: 240,
};
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = window.myGame.paths['game.css'];
document.head.appendChild(link);
window.myGame.LoadingOverlay = document.getElementById('loading-overlay');
window.myGame.canvas = document.getElementById('canvas');
window.myGame.canvas.width = window.myGame.baseWidth;
window.myGame.canvas.height = window.myGame.baseHeight;
window.myGame.overlay = document.getElementById('overlay');
window.myGame.buttonsOverlay = document.getElementById('buttons-overlay');
var script = document.createElement('script');
script.src = window.myGame.paths['main.js'];
document.body.appendChild(script);
</script>
</body>
</html>