-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.html
More file actions
72 lines (58 loc) · 1.9 KB
/
game.html
File metadata and controls
72 lines (58 loc) · 1.9 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>
<head>
<title>Play!</title>
<link rel = "stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<video id = "videoSource" muted autoplay width="240px" height="200px"></video>
<a id = "Catch"></a>
<a id = "distanceRemained"></a>
<a id = "bloodRemained"></a>
<div id = "result">
<p id = "resultMSG">ooops</p>
<button id = "anotherRound">Another Round</button>
</div>
<div id = "waitForReady">
<p id = "readyMSG">ooops</p>
<button id = "iAmReady">I Am Ready!</button>
</div>
<div id = "selectRole">
<p id = "roleMSG">ooops</p>
<button id = "playAsTom">Tom!</button>
<button id = "playAsJerry">Jerry!</button>
</div>
</body>
<script src = "js/vendor/three.min.js"></script>
<script src = "js/vendor/THREEx.KeyboardState.js"></script>
<script src = "js/vendor/clmtrackr.js"></script>
<script src = "js/vendor/camera.js"></script>
<script src = "js/vendor/model_pca_20_svm.js"></script>
<!-- <script src = "js/vendor/OrbitControls.js"></script> -->
<script src = "/socket.io/socket.io.js"></script>
<script src = "js/initScene.js"></script>
<script src = "js/mechanic.js"></script>
<script src = "js/socket.js"></script>
<script src = "js/result.js"></script>
<script src = "js/game.js"></script>
<script src = "js/script.js"></script>
<script>
tryGetIntoRoom();
// waitForSelect();
var render = function () {
if (gameStop) return;
var character;
if (role == 'tom')me= tom;
else me = jerry;
result();
updateCharacter(me);
emitPosition(me);
setCamera(me.position.x,me.position.y+cubeSize,me.position.z);
setPointLight(me.position.x,me.position.y,me.position.z);
if (role == 'tom') nextTom();
else updateJerryBlood();
updateDistanceRemained();
renderer.render(scene, camera);
};
animate();
</script>
</html>