diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-13 16:47:58 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-13 16:47:58 -0600 |
commit | 98e795029bcc404463ed151ff5255a72498bc641 (patch) | |
tree | 48e50d896d00761eae18c89f89e5dd0ef353b660 /engine/systems | |
parent | c6e9baa0009f7cce0f6ff156a3957ef04a8cb684 (diff) | |
download | jumpstorm-98e795029bcc404463ed151ff5255a72498bc641.tar.gz jumpstorm-98e795029bcc404463ed151ff5255a72498bc641.zip |
Create network component and system
Diffstat (limited to 'engine/systems')
-rw-r--r-- | engine/systems/Collision.ts | 6 | ||||
-rw-r--r-- | engine/systems/Input.ts | 2 | ||||
-rw-r--r-- | engine/systems/NetworkUpdate.ts | 10 | ||||
-rw-r--r-- | engine/systems/index.ts | 1 | ||||
-rw-r--r-- | engine/systems/names.ts | 1 |
5 files changed, 18 insertions, 2 deletions
diff --git a/engine/systems/Collision.ts b/engine/systems/Collision.ts index 2bba03b..1366ef4 100644 --- a/engine/systems/Collision.ts +++ b/engine/systems/Collision.ts @@ -63,7 +63,11 @@ export class Collision extends System { dimension = boundingBox.getOutscribedBoxDims(); } - this.quadTree.insert(entity.id, dimension, boundingBox.center); + this.quadTree.insert({ + id: entity.id, + dimension, + center: boundingBox.center, + }); }); // find colliding entities and perform collisions diff --git a/engine/systems/Input.ts b/engine/systems/Input.ts index 4aa9844..35d2e1d 100644 --- a/engine/systems/Input.ts +++ b/engine/systems/Input.ts @@ -9,7 +9,7 @@ import { import { Game } from "../Game"; import { KeyConstants, PhysicsConstants } from "../config"; import { Action } from "../interfaces"; -import { System, SystemNames } from "./"; +import { System, SystemNames } from "."; export class Input extends System { private keys: Set<string>; diff --git a/engine/systems/NetworkUpdate.ts b/engine/systems/NetworkUpdate.ts new file mode 100644 index 0000000..dc7be20 --- /dev/null +++ b/engine/systems/NetworkUpdate.ts @@ -0,0 +1,10 @@ +import { System, SystemNames } from "."; +import { Game } from "../Game"; + +export class NetworkUpdate extends System { + constructor() { + super(SystemNames.NetworkUpdate); + } + + public update(_dt: number, _game: Game) {} +} diff --git a/engine/systems/index.ts b/engine/systems/index.ts index 6cb6f35..075fc4e 100644 --- a/engine/systems/index.ts +++ b/engine/systems/index.ts @@ -6,3 +6,4 @@ export * from "./Input"; export * from "./FacingDirection"; export * from "./Collision"; export * from "./WallBounds"; +export * from "./NetworkUpdate"; diff --git a/engine/systems/names.ts b/engine/systems/names.ts index 23f31fc..cf66422 100644 --- a/engine/systems/names.ts +++ b/engine/systems/names.ts @@ -5,4 +5,5 @@ export namespace SystemNames { export const Input = "Input"; export const Collision = "Collision"; export const WallBounds = "WallBounds"; + export const NetworkUpdate = "NetworkUpdate"; } |