forked from jargdev/openWheels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
50 lines (42 loc) · 1.39 KB
/
Copy pathmain.js
File metadata and controls
50 lines (42 loc) · 1.39 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
44
45
46
47
48
49
50
function getTitleLabel() {
const labels = [
'Deobfuscated Edition',
'Hamburgers!',
'Flashless Version',
'Shoutouts to Simpleflips',
'Jim',
'Jacksepticeye, please come back..',
'Did you get the fat lady or the old man?',
'Happy 12th of July! If it.. actually is 12th of July..'
];
return labels[Math.floor(Math.random() * labels.length)];
}
function addScript(src) {
const script = document.createElement('script');
script.src = src;
document.head.appendChild(script);
return new Promise((resolve) => script.onload = resolve);
}
async function loadGame() {
const parameters = new URLSearchParams(location.search);
const getUrlParameter = (key) => parameters.get(key);
window.HW_SETTINGS = {
siteURL: './',
corsProxy: localStorage.getItem("proxy") || 'https://corsproxy.io/?url=',
pathPrefix: '',
titleLabel: getTitleLabel(),
titleLabelX: 645,
titleLabelY: 250,
titleLabelRotation: 0,
titleLabelSize: 20,
titleLabelColor: 0xfdfd65,
resolutionZoomIncreaseRatio: 0.5,
tesselation: 'tess2',
replay_id: getUrlParameter('replay_id'),
level_id: getUrlParameter('level_id')
};
await addScript(`./pixi.js`);
await addScript(`./dependencies.js`);
await addScript(`./happywheels.js`);
}
loadGame();