-
Notifications
You must be signed in to change notification settings - Fork 1
/
captureflag.htm
101 lines (90 loc) · 2.56 KB
/
captureflag.htm
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
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="content-security-policy" content="
base-uri 'self';
default-src 'none';
child-src blob:;
frame-src blob:;
connect-src https://api.stackexchange.com;
script-src 'self' 'unsafe-inline' blob:;
worker-src blob:;
style-src 'self';
img-src 'self';
form-action 'none';
">
<!-- these properties are read by the engine to configure the game -->
<title>Capture the Flag</title>
<link rel="icon" href="favicons/captureflag.png">
<meta name="stack-exchange-site" content="codegolf">
<meta name="stack-exchange-qid" content="49028">
<meta name="team-view-columns" content='[
{"title": "ID", "attribute": "userID"}
]'>
<meta name="team-type" content="user_id_modulo">
<meta name="team-type-args" content='{
"divide": 5,
"count": 2
}'>
<meta name="tournament-type" content="brawl">
<meta name="tournament-type-args" content='{}'>
<meta name="match-type" content="brawl">
<meta name="match-type-args" content='{
"count": 50,
"teamShuffle": "none"
}'>
<meta name="game-type" content="captureflag">
<meta name="game-config" content='{
"width": 350,
"height": 350,
"fieldPadding": 20,
"spawnPadding": 45,
"defenseRadius": 25,
"touchDistance": 10,
"initialStrength": 20,
"maxStrength": 20,
"jailStrength": 0,
"strengthGrowth": 2,
"maxFrame": 3000
}'>
<meta name="play-config" content='{
"delay": 10,
"speed": 1
}'>
<meta name="play-screensaver-config" content='{
"delay": 10,
"speed": 1,
"swapDelay": 5000
}'>
<meta name="display-config" content='{
"scale": 1
}'>
<meta name="default-code" content="/*
* Inputs:
* this - your bot (x, y, strength, id, isJailed)
* move - the current move number (starting at 0)
* tJailed - list of all jailed allies (x, y, strength, id, isJailed)
* eJailed - list of all jailed opponents (x, y, strength, id, isJailed)
* team - all allies
* enemies - all opponents
* tFlag - your team's flag (x, y, pickedUpBy); pickedUpBy is a bot object
* or null if not picked up
* eFlag - opponent team's flag (x, y, pickedUpBy)
* messages - shared messages object storing arbitrary data
* WIDTH - the width of the playfield
* HEIGHT - the height of the playfield
* FIELD_PADDING - distance from the corners of the board to the jails
* DEFENSE_RADIUS - minimum allowed distance to own flag / prison
*
* Return:
* an object containing the x and y delta to move
*/
return {x: 0, y: 0};
">
<script src="core/requirejs.js"></script>
<script src="engine/entry.js" async></script>
</head>
<body>
<noscript>This viewer requires Javascript!</noscript>
</body>
</html>