Skip to content

Commit

Permalink
feat(engine): added getIsMoving function
Browse files Browse the repository at this point in the history
  • Loading branch information
wialy committed Mar 6, 2024
1 parent 868884d commit f8e4762
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/features/engine/utils/get-is-moving/get-is-moving.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { VECTOR_ZERO } from '../../constants';
import { Entity, isMovable } from '../../types/entities';
import { getIsSameVector } from '../get-is-same-vector';

export const getIsMoving = (entity: Entity) =>
isMovable(entity) && !getIsSameVector(entity.velocity, VECTOR_ZERO);
1 change: 1 addition & 0 deletions src/features/engine/utils/get-is-moving/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './get-is-moving';

0 comments on commit f8e4762

Please sign in to comment.