-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
62 lines (60 loc) · 1.87 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>TunnelRunner.js</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="overlay">
<div id="score">0</div>
</div>
<div id="start">
<div id="message">Click to start!</div>
<div id="anaglyph" class="button">Toggle Anaglyph</div>
<div id="tracker" class="button">Toggle Tracker</div>
</div>
<div id="tracker_container">
<video id="video" width="160" height="120" class=""></video>
<canvas id="output" width="160" height="120" class=" alpha"></canvas>
</div>
<script src="js/color_tracker.js"></script>
<script async src="js/opencv/opencv.js" onload="Tracker.scriptLoaded()" type="text/javascript"></script>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/three.min.js"></script>
<script src="js/effects/anaglyph.js"></script>
<script src="js/game.js"></script>
<script>
$(function() {
$("#tracker").hide();
Game.init();
$("#start").on('click', function() {
$("#score").hide();
Game.reset();
});
$("#anaglyph").on('click', function(event) {
event.stopPropagation();
Game.properties.anaglyph = !Game.properties.anaglyph;
});
$("#tracker").on('click', function(event) {
event.stopPropagation();
Game.properties.tracker = !Game.properties.tracker;
if (Game.properties.tracker) {
Tracker.startTracking();
$("#output").show();
// Change difficulty
Game.properties.count = 5;
Game.spawnLevel();
} else {
Tracker.stopTracking();
$("#output").hide();
// Change difficulty
Game.properties.count = 25;
Game.spawnLevel();
}
});
});
</script>
</body>
</html>