[typings]: Restored deadInTracks

This commit is contained in:
corner 2020-04-12 16:30:34 +02:00
parent 27a30fd0ba
commit b049787caa

14
lib/index.d.ts vendored
View File

@ -604,6 +604,20 @@ interface NumericalEntity {pos: Coordinates, w: number, h: number}
interface NumericalEntityWithHitbox extends NumericalEntity {hitBox: NumericalEntity} interface NumericalEntityWithHitbox extends NumericalEntity {hitBox: NumericalEntity}
export namespace deadInTracks {
/**
* This functions checks whether ent walks against a non-walkable object and whether it should move in the x and y position and how much.
* The difference with wallslide is that deadInTracks stops the entity entirely when it touches a non-walkable surface.
* wallslide will move the entity in x or y if possible.
* @param ent The entity that is moving.
* @param map The TileMap the entity moves on.
* @param x The maximal movement on the x. default is 0
* @param y The maximal movement on the y. default is 0
* @returns Coordinates of how much the entity walks in x and y.
*/
export function deadInTracks(ent: NumericalEntity | NumericalEntityWithHitbox, map: TileMap, x?: number, y?: number): Coordinates;
}
export namespace wallslide { export namespace wallslide {
/** /**
* This functions checks whether ent walks against a non-walkable object and whether it should move in the x and y position and how much. * This functions checks whether ent walks against a non-walkable object and whether it should move in the x and y position and how much.