Player Object - siggame/MegaMinerAI-13 GitHub Wiki

Represents an AI

Variables

  • id - A unique ID to identify this player. If this is 0, then this player's hangar is on the left. This also indicates the index of this player in the player array.
  • playerName - A name chosen by the team who programmed the AI, has no effect on Gameplay
  • time - ???
  • scrapAmount - The amount of scrap this player has available to spend on droids. This value is increased by a constant amount (10) at the beginning of this player's turn.

Functions

* **orbitalDrop(_x, y, variant_)** - Tries to initiate the drop of a droid onto a tile. This does not happen instantly and requires a time proportional to the distance from the calling player's edge. 1. Droids cannot be dropped onto hangars. 2. Droids cannot be dropped onto tiles that already have a drop in progress. (This will be indicated by the tile's turnsUntilAssembled variable) 3. A player must have the required amount of scrap in order to drop a droid. The amount of scrap is determined by the variant of the droid being dropped. 4. Hangars cannot be dropped.

If the orbitalDrop succeeds then the target tile will be flagged as being a dropzone, having its owner set to the id of the player who is dropping the droid, its turnsUntilAssembled set to turns until the droid arrives, and the variantToAssemble being set to variant

Every player's turn the turnsUntilAssembled for that player's dropzones is decremented by one.

When this value reaches zero a droid is spawned at the beginning of that turn, and the tile's properties are reset (owner = 2)

Any droid that is on a dropzone when the new droid lands, will be destroyed.

⚠️ **GitHub.com Fallback** ⚠️