Skip to content

Commit

Permalink
fix planet collection distance
Browse files Browse the repository at this point in the history
  • Loading branch information
vpoulailleau committed Jan 16, 2024
1 parent 5b8f8f5 commit 1dd07cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Each command returns a response, made with:

- `{planet_id}` is between 0 and 65535
- `{ship_id}` is between 1 and 9
-
- `{abscissa}` and `{ordinate}` are between 0 and 19 999

### Move

Expand All @@ -60,6 +60,8 @@ Maximum speed:

Response is `OK`.

If a collector is less than 200 kms far from one of its planets, it collects the planet if it is not yet carrying a planet and it is not broken.

### Fire

`FIRE {ship_id} {angle}`
Expand All @@ -80,7 +82,9 @@ Starts the radar of an explorer.

Response is a one line string. It is composed of several elements, separated by commas. Those are based on entities at a distance less than 5 000 kms from the explorer. The elements are:

- `P {planet_id} {abscissa} {ordinate} {ship_id}`: one of your not yet collected planets, at a given position, the `ship_id` is the ID of the collector that collected the plane, or -1 if not collected
- `P {planet_id} {abscissa} {ordinate} {ship_id} {saved}`: one of your not yet collected planets, at a given position, the `ship_id` is the ID of the collector that collected the plane, or -1 if not collected, `saved` is 1 when planet is at base station, otherwise 0
- `S {team} {ship_id} {abscissa} {ordinate} {broken}`: a spaceship, team 0 is yours, team 1 to 3 are opponents, broken is 0 or 1, 1 meaning that the ship was targeted by a high energy attack
- `B {abscissa} {ordinate}`: your base station's position (always present in radar information)

## Commands

Expand Down
2 changes: 1 addition & 1 deletion space_collector/game/constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DISTANCE_PLANET_COLLECTION = 200 # TODO mettre moins, le reporter dans le README
DISTANCE_PLANET_COLLECTION = 200
MAP_DIMENSION = 20_000

0 comments on commit 1dd07cd

Please sign in to comment.