...
To detect when your own objects are destroyed, it's easier to use eventDestroyed() because it avoids having to bind to individual objects.
Availability
3.1 Beta 1 and above.
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
bind(functionName,gameObject); |
...
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
functionName | String | The name of the function that should be called immediately before the gameObject is destroyed. | 3.1 Beta 1 | |
gameObject | Droid object, Structure object, Feature object | Any game object, such as a droid, structure or feature. | 3.1 Beta 1 |
Return value
Value | Type | Description | Game version |
---|---|---|---|
undefined | Undefined | Indicates the bind was successful. | 3.1 Beta 1 |
<error> | Error | Indicates there was a problem (did you remember to specify functionName as as a string?) | 3.1 Beta 1 |
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
function certainDeath(gameObject) { // do stuff } bind("certainDeath",someObject); // where someObject would be a droid, structure or feature object |
...