-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
53 lines (49 loc) · 2.42 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
<!doctype html>
<html style="width:100%;height:100%;padding:0;margin:0;border:0;">
<head>
<meta charset="UTF-8">
<link rel="canonical" href="https://formulky.cz/" />
<link rel="icon" type="image/png" href="favicon.png" />
</head>
<body id="body" style="width:100%;height:100%;padding:0;margin:0;border:0;overflow:hidden;">
<div id="wrapper" style="padding:0;margin:0;border:0;height:100%;width:100%;text-align:center;">
<canvas id="canvas" style="display:inline-block;width:100%;height:100%;margin:0px;border:0px solid #000000;padding:0;box-sizing: border-box;">
</canvas>
</div>
<script src="scripts/model/geometry.js"></script>
<script src="scripts/model/designer.js"></script>
<script src="scripts/model/model.js"></script>
<script src="scripts/model/player.js"></script>
<script src="scripts/model/race.js"></script>
<script src="scripts/model/track.js"></script>
<script src="scripts/model/physics.js"></script>
<script src="scripts/model/trajectory.js"></script>
<script src="scripts/view/view.js"></script>
<script src="scripts/view/sound.js"></script>
<script src="scripts/controller/controller.js"></script>
<script src="scripts/algorithm/parseSvgPathData.js"></script>
<script src="scripts/algorithm/quadtree.js"></script>
<script src="scripts/algorithm/tinyqueue.min.js"></script>
<script src="scripts/algorithm/ai.js"></script>
<script src="scripts/algorithm/utils.js"></script>
<script src="scripts/algorithm/optimization.js"></script>
<script src="scripts/algorithm/Intersection.min.js"></script>
<script src="scripts/algorithm/MyFast2Dv3.js"></script>
<script src="scripts/algorithm/avoid.js"></script>
<script src="scripts/raphael-2.2.0.min.b2.js"></script>
<script type="text/javascript">
let view = new View("canvas");
let model = new Model().updates(view);
let controller = new Controller("body").manipulates(model, view);
let track = "T 25 0 100 275 S 170 C -70 100 S 50 C 225 50 C -140 40 S 50 C -100 50 S 20 C -75 170 C -35 120 z G 10 -20 15 P 900 F 100";
const urlParams = new URLSearchParams(window.location.search);
track = (urlParams.get("track")||track);
let players = (urlParams.get("players")||"1H").split("");
//let randomize = parseFloat(urlParams.get("randomize")||"0.0");
//console.log(JSON.stringify(players));
model.startRace(track, players);
document.onreadystatechange = function() { controller.resizePaper() };
model.startAnimation();
</script>
</body>
</html>