@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
32 lines (23 loc) • 617 B
JavaScript
import { BehaviorStatus } from "../BehaviorStatus.js";
import { EntityBehavior } from "./EntityBehavior.js";
/**
* Makes the entity destroy itself
*
* @author Alex Goldring
* @copyright Company Named Limited (c) 2025
*/
export class DieBehavior extends EntityBehavior {
/**
* Constructor alias
* @return {DieBehavior}
*/
static create() {
return new DieBehavior();
}
tick(timeDelta) {
const entity = this.entity;
const ecd = this.ecd;
ecd.removeEntity(entity);
return BehaviorStatus.Succeeded;
}
}