diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-17 22:42:09 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-17 22:42:09 -0600 |
commit | 432ce5428f357f31ae090d55c5183b4eccd5a37c (patch) | |
tree | a616ff32a1ac2a3f305c089954cdf6e6432f1ad8 /client/src | |
parent | 1c28e10b860056d85cc07e5a834c4a54eac14563 (diff) | |
download | jumpstorm-432ce5428f357f31ae090d55c5183b4eccd5a37c.tar.gz jumpstorm-432ce5428f357f31ae090d55c5183b4eccd5a37c.zip |
increase collision performance _heavily_
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/JumpStorm.ts | 9 |
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, |