From 432ce5428f357f31ae090d55c5183b4eccd5a37c Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Thu, 17 Aug 2023 22:42:09 -0600 Subject: increase collision performance _heavily_ --- client/src/JumpStorm.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'client') 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, -- cgit v1.2.3-70-g09d2