Foundation.Actor
The actor type is the base tangible updatable element.
Example
// Extend the actor type
class MyActor extends Foundation.Actor{
// Override update method
public update(): boolean {
if (super.update()) {
console.log('updating');
return true;
} else {
return false;
}
}
}
// Create a prefab game object
var game = Foundation.Game.createDefaultPrefab();
// Add a MyActor instance to the game
game.add('Printer', new MyActor());
Implementation Details
Reference paths
'/foundation/_digest.ts''/foundation/core/actors/_digest.ts''/foundation/core/actors/Actor.ts'
Extends
This type does not extend a base type.
Implements
This type implements the following interfaces:
Public Properties
active: boolean
- Get or set the actor active state.
Constructors
constructor(active: boolean = true)
- Actors are active by default.
Instance Methods
free(): void
- Base implementation for overriding. Should be used to free any actor resources (event listeners etc.)