Versions Compared

Key

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

Overview

Excerpt

Activates the special feature of a structure, such as firing laser satellite.

Syntax

Code Block
themeEclipse
languagejavascript
linenumberstrue
activateStructure(structure,target);

Parameters

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

Game object

{x:x, y:y}

(tick)The target location – this can be a game object, or any other object that has x,y properties.

Return value

Not specified.

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);
}

See Also