Collectibles
You can spawn collectible weapons in the playfield
You can also find a collectible with a specific id using game.findCollectible(id)
, which returns an object represents the matched collectible or null
(if no collectibles are matching the provided id)
Creation
Here is an example:
> game.addCollectible({code:10,x:0,y:0});
> █
This will add a new collectible pack of rockets to coordinates (0;0)
Here is the list of supported codes:
(Note: Server will respond with Incorrect data
when at least one input property value is improper)
Code | Description |
---|---|
10 | 4 rockets pack |
11 | 2 missiles pack |
12 | 1 torpedo |
20 | 8 light mines pack |
21 | 4 heavy mines pack |
40 | Mining pod |
41 | Attack pod |
42 | Defense pod |
90 | Energy refill |
91 | Shield refill |
Limits
You can only have 50 active collectibles (including collectibles generated by the game mode) at any time in your game
The server will respond with Too many Collectibles
for each collectible passing the limit
Accessing
For each collectible object in game.collectibles
, You have access to the same properties as the available ones when you add collectibles, plus some additional properties:
Option | Description |
---|---|
game | Points to the global game object |
id | a unique identifier for the collectible |