summaryrefslogtreecommitdiff
path: root/client/src/JumpStorm.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-08-17 22:42:09 -0600
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-08-17 22:42:09 -0600
commit432ce5428f357f31ae090d55c5183b4eccd5a37c (patch)
treea616ff32a1ac2a3f305c089954cdf6e6432f1ad8 /client/src/JumpStorm.ts
parent1c28e10b860056d85cc07e5a834c4a54eac14563 (diff)
downloadjumpstorm-432ce5428f357f31ae090d55c5183b4eccd5a37c.tar.gz
jumpstorm-432ce5428f357f31ae090d55c5183b4eccd5a37c.zip
increase collision performance _heavily_
Diffstat (limited to 'client/src/JumpStorm.ts')
-rw-r--r--client/src/JumpStorm.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/JumpStorm.ts b/client/src/JumpStorm.ts
index 8075cc8..008ba13 100644
--- a/client/src/JumpStorm.ts
+++ b/client/src/JumpStorm.ts
@@ -1,5 +1,7 @@
import { Floor, Player } from "@engine/entities";
import { Game } from "@engine/Game";
+import { Grid } from "@engine/structures";
+import { Miscellaneous } from "@engine/config";
import {
WallBounds,
FacingDirection,
@@ -65,11 +67,16 @@ export class JumpStorm {
socket,
);
+ const grid = new Grid(
+ { width: Miscellaneous.WIDTH, height: Miscellaneous.HEIGHT },
+ { width: 30, height: 30 },
+ );
+
[
this.createInputSystem(),
new FacingDirection(),
new Physics(),
- new Collision(),
+ new Collision(grid),
new WallBounds(ctx.canvas.width),
new NetworkUpdate(
clientSocketMessageQueueProvider,