feat: migrate JavaScript files to TypeScript, enhancing type safety and maintainability across the codebase
This commit is contained in:
parent
3db2bb9160
commit
c582f2004e
107 changed files with 5876 additions and 3588 deletions
26
src/components/Velocity.ts
Normal file
26
src/components/Velocity.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { Component } from '../core/Component.ts';
|
||||
import { ComponentType } from '../core/Constants.ts';
|
||||
|
||||
/**
|
||||
* Component for tracking entity velocity and movement speed limits.
|
||||
*/
|
||||
export class Velocity extends Component {
|
||||
vx: number;
|
||||
vy: number;
|
||||
maxSpeed: number;
|
||||
isLocked: boolean;
|
||||
lockTimer: number;
|
||||
|
||||
/**
|
||||
* @param vx - Initial X velocity
|
||||
* @param vy - Initial Y velocity
|
||||
*/
|
||||
constructor(vx = 0, vy = 0) {
|
||||
super(ComponentType.VELOCITY);
|
||||
this.vx = vx;
|
||||
this.vy = vy;
|
||||
this.maxSpeed = 200;
|
||||
this.isLocked = false;
|
||||
this.lockTimer = 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue