-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (44 loc) · 1.36 KB
/
index.html
File metadata and controls
47 lines (44 loc) · 1.36 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>PONG</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='main.css'>
<link rel='stylesheet' type='text/css' media='screen' href='bootstrap.min.css'>
<script type="importmap">
{
"imports": {
"three": "/PONG/js/three/three.module.js",
"three/addons/": "/PONG/js/three/addons/"
}
}
</script>
<script type="module">
import { launchGame, createGame } from './js/main.js';
async function startGame() {
document.getElementById('game').removeEventListener('click', startGame);
setTimeout(() => {
for (let i = 0; i < document.getElementsByClassName("score").length; i++) {
document.getElementsByClassName("score")[i].style.opacity = 1;
}
}, 3000);
console.log(await launchGame(window.propreties));
}
document.getElementById('game').addEventListener('click', startGame);
window.propreties = await createGame("Player 1", "Player 2");
</script>
</head>
<body>
<div id="game">
<canvas id="canvas"></canvas>
<div id="filter"></div>
<div id="scoreL" class="score" style="left: 30%;">0</div>
<div id="scoreR" class="score" style="left: 60%">0</div>
<center>
<div id="endScreen">Loading</div>
</center>
</div>
</body>
</html>