Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ParameterTypeMandatoryDescription
structureStructure object(tick)The structure that will perform the special action.
target

Game object

{x:xPos, y:yPos}

(tick)

The target location – this can be a game object,

or any other object that has x,y properties.

Return value

...

ValueTypeDescription
trueBooleanThe structure was activated
<error>ErrorSomething went wrong

Example

Code Block
themeEclipse
languagejavascript
titleToast the most recent droid/building that attacked me
linenumberstrue
var lastAttacker;
 
function eventAttacked(victim,attacker) {
  lastAttacker = attacker;
}
function eventStructureReady(structure) {
  if (structure.stattype == LASSAT) activateStructure(structure,lastAttacker);
}

...