Overview
Excerpt |
---|
Activates the special feature of a structure, such as firing laser satellite. |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
activateStructure(structure,target); |
Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
structure | Structure object | The structure that will perform the special action. | |
target | Game object {x:x, y:y} | 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 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var lastAttacker;
function eventAttacked(victim,attacker) {
lastAttacker = attacker;
}
function eventStructureReady(structure) {
if (structure.stattype == LASSAT) activateStructure(structure,lastAttacker);
} |
See Also
- structureIdle() – find out if a given structure is ready
- eventStructureReady() – an event that's triggered when a structure is ready for its next command