|
1 | 1 | # Worm-Arena |
2 | | -Worm is a [Snake](https://en.wikipedia.org/wiki/Snake_(video_game_genre)) like arena. |
3 | | -Click the image below to join the official Discord channel. |
| 2 | + |
| 3 | +Worm is a [Snake](https://en.wikipedia.org/wiki/Snake_(video_game_genre)) like arena. Click the image below to join the official Discord channel. |
4 | 4 | <br>[](https://discord.gg/wtFvtECqSX) |
5 | 5 |
|
6 | 6 | Participants receives a multidimensional array representing the current state of the arena and responds with the direction the worm should travel next. Possible responses are `'x+'`, `'x-'`, `'y+'`, `'y-'`, `'z-'` and `'z+'`. Responding with a invalid move (like turning backwards) results in moving forward. |
7 | 7 |
|
8 | 8 | **Message example** |
9 | | -``` JavaScript |
10 | | -[[[{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":4,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":{"type":"SolidWorm","team":3,"isLastTrailingBody":false},"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]}],[{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":2,"other":0},"occupiedBy":null,"grave":[]}],[{"eatables":{"apple":null,"other":0},"occupiedBy":{"type":"SolidWorm","team":1,"isLastTrailingBody":false},"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":{"type":"SolidWorm","team":0,"isLastTrailingBody":false},"grave":[]}],[{"eatables":{"apple":3,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]}],[{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":{"type":"SolidWorm","team":2,"isLastTrailingBody":false},"grave":[]},{"eatables":{"apple":1,"other":0},"occupiedBy":null,"grave":[]},{"eatables":{"apple":null,"other":0},"occupiedBy":null,"grave":[]}]]] |
| 9 | + |
| 10 | +```JavaScript |
| 11 | +;[[[{ 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': 4, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': { 'type': 'SolidWorm', 'team': 3, 'isLastTrailingBody': false }, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }], [{ 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': 2, 'other': 0 }, 'occupiedBy': null, 'grave': [] }], [{ 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': { 'type': 'SolidWorm', 'team': 1, 'isLastTrailingBody': false }, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': { 'type': 'SolidWorm', 'team': 0, 'isLastTrailingBody': false }, 'grave': [] }], [{ 'eatables': { 'apple': 3, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }], [{ 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': { 'type': 'SolidWorm', 'team': 2, 'isLastTrailingBody': false }, 'grave': [] }, { 'eatables': { 'apple': 1, 'other': 0 }, 'occupiedBy': null, 'grave': [] }, { 'eatables': { 'apple': null, 'other': 0 }, 'occupiedBy': null, 'grave': [] }]]] |
11 | 12 | ``` |
| 13 | + |
12 | 14 | Note that `eatables.apple` can either be `null` or a number. The number only represent an ID and is always only worth one point. When a worm is defeated and leaves eatables behind, they are put into `eatables.other`. |
13 | 15 |
|
14 | 16 | **Eatable example** |
15 | | -``` JavaScript |
| 17 | + |
| 18 | +```JavaScript |
16 | 19 | {"eatables":{"apple":0,"other":0}} |
17 | 20 | ``` |
18 | 21 |
|
19 | 22 | ## Configurations |
20 | | -*Basic description of each parameter. Some parameter combinations is incompatible. Read more at the arena.* |
21 | | -| Scope | Value | Description | |
22 | | -| --- | --- |---| |
23 | | -| `arena` | `size` | Defines the size (length of each side) of the arena. | |
24 | | -| `arena` | `threeDimensions` | If enable the size of the arena is `size*size*size` instead of `size*size`. | |
25 | | -| `border` | `noOuterBorder` | If enable the worm will appear of the opposite side of the arena instead of colliding with a wall. | |
26 | | -| `border` | `movesPerArenaShrink` | How many moves a worm can make before the arena shrinks. | |
27 | | -| `border` | `shrinkMode` | • `RandomPlacedWall_single`<br>A random wall is placed anywhere on the arena. <br>• `RandomPlacedWall_fourSymmetry`<br>Four walls are placed symmetrically on the arena. <br>• `RandomPlacedWall_perWorm`<br>One random wall pere living worm is placed anywhere on the arena. <br>• `WallOuterArea`<br>Playable arena shrinks my placing a wall on the most outer sides. | |
28 | | -| `rules` | `startLength` | How long the worm will start as. | |
29 | | -| `rules` | `apples` | How many apples is located at the arena and how they are placed. | |
30 | | -| `rules` | `defeatedWorms` | What will happen to a defeated worm.<br>• `Disappears`<br>Defeated worms are removed.<br>• `Eatable`<br>Defeated worms becomes eatable for extra points.<br>• `Solid`<br>Defeated worms turns into a wall. | |
31 | | -| `rules` | `winner` | • `LastWormStanding`<br>Participants that are alive receive one point each time a worm is defeated. <br>• `MostPoints`<br>Participants receive one point for every eaten object until there is no more worms alive.| |
32 | | -| `rules` | `bonusToLonger` | If two worms score equal, bonus point is dealt to the longer worm. | |
| 23 | + |
| 24 | +_Basic description of each parameter. Some parameter combinations is incompatible. Read more at the arena._ |
| 25 | + |
| 26 | +| Scope | Value | Description | |
| 27 | +| -------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 28 | +| `arena` | `size` | Defines the size (length of each side) of the arena. | |
| 29 | +| `arena` | `threeDimensions` | If enable the size of the arena is `size*size*size` instead of `size*size`. | |
| 30 | +| `border` | `noOuterBorder` | If enable the worm will appear of the opposite side of the arena instead of colliding with a wall. | |
| 31 | +| `border` | `movesPerArenaShrink` | How many moves a worm can make before the arena shrinks. | |
| 32 | +| `border` | `shrinkMode` | • `RandomPlacedWall_single`<br>A random wall is placed anywhere on the arena. <br>• `RandomPlacedWall_fourSymmetry`<br>Four walls are placed symmetrically on the arena. <br>• `RandomPlacedWall_perWorm`<br>One random wall pere living worm is placed anywhere on the arena. <br>• `WallOuterArea`<br>Playable arena shrinks my placing a wall on the most outer sides. | |
| 33 | +| `rules` | `startLength` | How long the worm will start as. | |
| 34 | +| `rules` | `apples` | How many apples is located at the arena and how they are placed. | |
| 35 | +| `rules` | `defeatedWorms` | What will happen to a defeated worm.<br>• `Disappears`<br>Defeated worms are removed.<br>• `Eatable`<br>Defeated worms becomes eatable for extra points.<br>• `Solid`<br>Defeated worms turns into a wall. | |
| 36 | +| `rules` | `winner` | • `LastWormStanding`<br>Participants that are alive receive one point each time a worm is defeated. <br>• `MostPoints`<br>Participants receive one point for every eaten object until there is no more worms alive. | |
| 37 | +| `rules` | `bonusToLonger` | If two worms score equal, bonus point is dealt to the longer worm. | |
33 | 38 |
|
34 | 39 | To keep the challenge for all worms to be symmetric and equal, make sure to keep the amount of teams to an even number. |
0 commit comments