-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathclearHighscores.html
136 lines (86 loc) · 3.77 KB
/
clearHighscores.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html public>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link href="css/styleSlidersGame.css" rel="stylesheet" type="text/css" ></img>
<link href="css/styleGame.css" rel="stylesheet" type="text/css"></img>
<link rel="shortcut icon" type="image/jpg" href="./favicon.jpg">
<script type="text/javascript" src="js/jquery-1.12.4.min.js">
</script>
<title>Microsimulation of Traffic Flow: Onramp</title>
</head>
<body>
<!-- ############################################## -->
<!-- header: title image loaded as background image via css -->
<!-- ############################################## -->
<div id="header">
<!-- <img class="title" src="figs/title.png" width="100%"></img> -->
</div>
<!-- ############################################## -->
<!-- Buttons -->
<!-- ############################################## -->
<button onclick='clearHighscores_rampMeteringGame();'>
Clear Highscores ramp-metering game</button>
<button onclick='clearHighscores_routingGame();'>
Clear Highscores routing game</button>
<!-- redirects to other scenarios, defines myRedirectX -->
<script src="js/redirect.js" type="text/javascript"></script>
<!-- ############################################## -->
<!-- the actual simulation canvas -->
<!-- ############################################## -->
<!-- ############################################## -->
<!-- Info text including display of results (filled by showInfo())
<!-- ############################################## -->
<div id="infotextRampMeteringGame"> </div>
<!-- ################################################# -->
<!-- No main sliders to control the game: only traffic lights/speed limits -->
<!-- ################################################# -->
<!-- ############################################## -->
<!-- info-text inside sliders-div (filled by showInfo())
<!-- ############################################## -->
<br>
<div id="infotext"></div>
<div id="infotextRoutingGame"> </div>
</center>
</div> <!-- id="sliders">-->
<!-- ########################################################## -->
<!-- specific scripts; position below any simulation elements ! -->
<!-- ########################################################## -->
<script src="js/seedrandom.min.js"></script> <!-- random w seed debug -->
<script src="js/timeView.js" type="text/javascript"></script>
<script src="js/media.js" type="text/javascript"></script>
<script src="js/control_gui.js"></script>
<script src="js/canvas_gui.js"></script>
<script src="js/TrafficObjects.js"></script>
<script src="js/TrafficLightControlEditor.js"></script>
<script src="js/colormanip.js"></script>
<script src="js/models.js"></script>
<script src="js/vehicle.js"></script>
<script src="js/paths.js"></script>
<script src="js/road.js"></script>
<script src="js/stationaryDetector.js"></script>
<script src="js/rampMeteringGameInfo.js"></script>
<script src="js/routingGameInfo.js"></script>
<!-- PROJ--> <script src="js/rampMeteringGame.js"></script>
<!-- cannot load the second project because double def leads to
<!-- syntax errorstopping further loading-->
<script>
function clearHighscores_routingGame(){
deleteHighscores("routingGame_Highscores");
time=10000;
nick="The Worst Controller"
finishRoutingGame("infotextRoutingGame");
}
function finishRoutingGame(infotextID){
isGame=false;
qIn=qInInit;
var roundedTime=parseFloat(time).toFixed(1);
var messageText=updateHighscores(nick,roundedTime,
"routingGame_Highscores");
document.getElementById(infotextID).innerHTML=messageText;
console.log("Game finished in ",time," seconds!");
myStartStopFunction(); // reset game
}
</script>
</body>
</html>