-
Notifications
You must be signed in to change notification settings - Fork 1
/
fgtw.htm
117 lines (105 loc) · 2.77 KB
/
fgtw.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<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>Fastest gun of the west</title>
<link rel="icon" href="favicons/fgtw.png">
<meta name="stack-exchange-site" content="codegolf">
<meta name="stack-exchange-qid" content="51698">
<meta name="stack-exchange-code-template" content="function attributes() {
{{codeblock:0, prefix: }}
}
function main(bulletsLeft, yourShots, enemyShots, yourMovement, enemyMovement) {
{{codeblock:1, prefix: }}
}
">
<meta name="team-view-columns" content='[]'>
<meta name="team-type" content="free_for_all">
<meta name="team-type-args" content='{}'>
<meta name="tournament-type" content="all_v_all">
<meta name="tournament-type-args" content='{
"teamLimit": 2
}'>
<meta name="match-type" content="brawl">
<meta name="match-type-args" content='{
"count": 50,
"teamShuffle": "roundRobin"
}'>
<meta name="game-type" content="fgtw">
<meta name="game-config" content='{
"cells": 24,
"initialCell": 12,
"freeBullets": 1,
"bulletCost": 1,
"baseReloadSpeed": 4,
"reloadCost": 2,
"freeShotsPerTurn": 1,
"shotPerTurnCost": 3,
"freeMoveSpeed": 1,
"moveSpeedCost": 3,
"totalPoints": 15,
"maxFrame": 66
}'>
<meta name="play-config" content='{
"delay": 50,
"speed": 1
}'>
<meta name="display-config" content='{
"scaleX": 30,
"scaleY": 50
}'>
<meta name="default-code" content="/*
* attributes is called once at the start of the game
*/
function attributes() {
return {
name: 'foobar',
numbOfBullets: 7,
reloadSpeed: 1,
shotsPerTurn: 1,
moveSpeed: 2,
};
}
/*
* main is called each turn.
* Input:
* bulletsLeft - number of bullets remaining in your gun
* yourShots - array of shots you have taken over previous turns; each enry
* is an array of locations shot at that turn
* enemyShots - array of shots taken by your enemy over previous turns
* yourMovement - array of your past positions
* enemyMovement - array of enemy past positions
*
* Return:
* An object containing:
* shots - array of cells to shoot
* move - number denoting space to move to
* reload - true to begin reloading
*/
function main(bulletsLeft, yourShots, enemyShots, yourMovement, enemyMovement) {
return {
shots: [],
move: [],
reload: false,
};
}
">
<script src="core/requirejs.js"></script>
<script src="engine/entry.js" async></script>
</head>
<body>
<noscript>This viewer requires Javascript!</noscript>
</body>
</html>