-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy paththe_clappers.html
153 lines (137 loc) · 5.57 KB
/
the_clappers.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE HTML>
<html>
<head>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'XXX-google-analytics-id-XXX', 'auto');
ga('send', 'pageview');
</script>
<title>Grid Game</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<script type="text/javascript" src="./lib/external/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="./lib/grid_game.js"></script>
<script type="text/javascript" src="./lib/gist_cache.js"></script>
<script type="text/javascript" src="./lib/resize_grid.js"></script>
<script type="text/javascript" src="./config/game.js"></script>
<script type="text/javascript" src="./lib/positions.js"></script>
<script type="text/javascript" src="./config/players.js"></script>
<script type="text/javascript" src="./config/bots.js"></script>
<script type="text/javascript" src="./lib/info.js"></script>
<script type="text/javascript" src="./lib/data/key_maps.js"></script>
<script type="text/javascript" src="./lib/data/key_display.js"></script>
<script type="text/javascript" src="./lib/player_components/control_panel.js"></script>
<script type="text/javascript" src="./lib/player_components/direction_change.js"></script>
<script type="text/javascript" src="./lib/turn_phases/mark_movement_phase.js"></script>
<script type="text/javascript" src="./lib/turn_phases/do_movement_phase.js"></script>
<script type="text/javascript" src="./lib/turn_phases/mark_damage_phase.js"></script>
<script type="text/javascript" src="./lib/turn_phases/do_damage_phase.js"></script>
<script type="text/javascript" src="./lib/classes/tile.js"></script>
<script type="text/javascript" src="./lib/classes/board.js"></script>
<script type="text/javascript" src="./lib/classes/player.js"></script>
<script type="text/javascript" src="./lib/classes/keyboard.js"></script>
<script type="text/javascript" src="./lib/classes/api.js"></script>
<script type="text/javascript" src="./lib/api_ui.js"></script>
<link rel="stylesheet" href="./style/grid_game.css"/>
</head>
<body>
<h1>Grid Game</h1>
<div id="grid_game"></div>
<div id="api_space">
<div id="forms"></div>
<div class="button" data-action="start">Start</div>
<div class="button" data-action="stop">Stop</div>
<div class="button" data-action="reset">Reset</div>
</div>
<br clear="both"/>
<div class="info">
<p class="turn"><b>Turn:</b> <span id="turn">0</span></p>
<table id="data">
<tr>
<th>Cities</th>
<td data-role="cities" class=green>0</td>
<td data-role="cities" class="red">0</td>
</tr>
<tr>
<th>Walkers</th>
<td data-role="walkers" class=green>0</td>
<td data-role="walkers" class="red">0</td>
</tr>
<tr>
<th>Total health</th>
<td data-role="overall" class=green>0</td>
<td data-role="overall" class="red">0</td>
</tr>
</table>
</div>
<div class="footer">
<p>
<a href="https://www.github.com/AJFaraday/grid_game" target="_blank">Grid Game</a>
is a board-like game concept by
<a href="https://www.twitter.com/MarmiteJunction" target="_blank">Andrew Faraday</a>.
</p>
<p>It's a pretty juvenile project, so bear with me. It's still being built and updated.</p>
<p>
Feel free to let me know about any issues you find using the
<a href="https://github.com/AJFaraday/grid_game/issues" target="_blank">issue tracker</a>.
</p>
<p>Modes of play:</p>
<ul>
<li><a href="index.html">Bot v Bot</a></li>
<li><a href="manual.html">Manual (simple)</a></li>
<li><a href="obstacles.html">Manual (with obstacles)</a></li>
<li><a href="tournament.html">Bot v Bot (Tournament Mode)</a></li>
</ul>
</div>
<div class="modal_background"></div>
<script type="text/javascript">
function set_player_to_gist(colour, gist) {
var api_space;
if (colour == 'green') {
api_space = $('div.api_space.api_0');
} else if (colour == 'red') {
api_space = $('div.api_space.api_1');
}
var select = api_space.find('select');
var options = [];
select.find('option').each(function (i, o) {
options.push($(o).attr('value'));
});
if (options.includes(gist)) {
select.val(gist).trigger('change');
} else {
select.val('bot_id').trigger('change');
select.siblings('input').val(gist).trigger('change');
}
}
$(window).ready(function () {
GridGame.init(
{
tournament: true,
turn_time: 1
}
);
GridGame.api_ui.init();
url = new URL(window.location);
red_gist = url.searchParams.get('red');
if (red_gist) {
set_player_to_gist('red', red_gist)
}
green_gist = url.searchParams.get('green');
if (green_gist) {
set_player_to_gist('green', green_gist)
}
});
</script>
</body>
</html>