Description
Project description
Space collector
Space collector game
TODO
- tracer les planetes puis les vaisseaux (pas par joueur, mais globalement)
- limiter dans la fréquence des radars
- Planet destruction with high energy attack?
- Des points si on tire sur quelqu'un ?
- When a team has collected all its planets, the game stops
- When the game ran 5 minutes, the game stops
Rules
- Square 20 000 x 20 000 kms
- Collect your planets with your collector
- Slow speed
- Attack enemies with your five attackers
- Fast speed
- High energy attack < 5 000 kms
- choose angle
- 1 second to wait between fires of an attacker
- Explore with your explorer
- Normal speed
- See its planets and all spaceships around him < 5 000 kms
- When a unit is touched by a high energy attack
- Must return to its base to be repaired
- Attacker can't attack
- Explorators can't use their radar to see enemy spaceships
- Collectors can't collect planets, they loose the collected planets (left in place)
- Must return to its base to be repaired
- When a team has collected all its planets, the game stops
- When the game ran 5 minutes, the game stops
Commands
General syntax
COMMAND {ship_id} {parameters}
{ship_id}
: identifier of the spaceship- 1, 2, 3, 4, 5: attackers
- 6, 7: explorers
- 8, 9: collectors
{parameters}
: parameters of the command{angle}
: integer, degrees, between 0 and 359, counter clockwise, 0 pointing right{speed}
: integer in kms/s
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
MOVE {ship_id} {angle} {speed}
Changes the speed and angle of the spaceship.
Maximum speed:
- 1 000 kms/s for collectors
- 2 000 kms/s for explorers
- 3 000 kms/s for attackers
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}
Fire a high energy attack, at {angle}
angle. Length of the attack is 5 000 kms.
This command is only valid for an attacker.
Response is OK
.
Radar
RADAR {ship_id}
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} {saved}
: one of your not yet collected planets, at a given position, theship_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 0S {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 (your spaceships are always present even if the explorer is broken)B {abscissa} {ordinate}
: your base station's position (always present in radar information)
If an explorer is broken, it can't see enemy spaceships.
Commands
Installation
python3.11 -m venv venv
. venv/bin/activate
pip install -e .[dev] # to get the dev dependencies
Install git hook
pre-commit install
Lint
flake8
Launch test
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file space_collector-0.0.1.tar.gz
.
File metadata
- Download URL: space_collector-0.0.1.tar.gz
- Upload date:
- Size: 19.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36fbfa6941da92f5372f81f85c52434f227edd08ccf47bc35566ff0f1a429ed |
|
MD5 | db613786122375e6c1e18c25dad2e7d0 |
|
BLAKE2b-256 | 62fe350e0b2a21a717f381bd7aef9d3c78376f4ce1c8bd3080db8007c25735d8 |
File details
Details for the file space_collector-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: space_collector-0.0.1-py3-none-any.whl
- Upload date:
- Size: 18.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd3007ae214842de4d9de215973e32f27265ae2a56903c22d28c8c375196142f |
|
MD5 | bb82b45b86d2d6a1c4f1118fd5d0ab7e |
|
BLAKE2b-256 | a7ba57aa705ce869230a82b9bcc5301c4bc1405c31974890ad6c5a59c669f161 |