jumpstorm/engine/components/Control.ts

19 lines
540 B
TypeScript
Raw Normal View History

2023-08-25 18:48:17 -04:00
import { Component, ComponentNames, Velocity } from '.';
2023-07-19 23:38:24 -04:00
export class Control extends Component {
public controlVelocityComponent: Velocity;
2023-08-23 21:44:59 -04:00
public controllableBy: string;
2023-08-26 19:55:27 -04:00
public isControllable: boolean; // computed each update in the input system
2023-08-12 15:49:16 -04:00
constructor(
2023-08-23 21:44:59 -04:00
controllableBy: string,
2023-08-25 18:48:17 -04:00
controlVelocityComponent: Velocity = new Velocity()
) {
2023-07-19 23:38:24 -04:00
super(ComponentNames.Control);
2023-08-12 15:49:16 -04:00
2023-08-23 21:44:59 -04:00
this.controllableBy = controllableBy;
this.controlVelocityComponent = controlVelocityComponent;
2023-08-26 19:55:27 -04:00
this.isControllable = false;
2023-07-19 23:38:24 -04:00
}
}