From 2e2ce46f6fe62f6cba1b1b3a7c03d17202ffbb8d Mon Sep 17 00:00:00 2001 From: Jack Le Hamster Date: Thu, 11 Apr 2024 14:16:07 -0700 Subject: [PATCH] WIP --- example/dist/index.js | 16 ++++++++-------- src/demo/DemoGame.ts | 35 ++++++++++++++++++++--------------- src/index.tsx | 1 - 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/example/dist/index.js b/example/dist/index.js index b60573d..248a91c 100644 --- a/example/dist/index.js +++ b/example/dist/index.js @@ -52813,12 +52813,12 @@ class DemoGame extends AuxiliaryHolder { })); cellTriggerTracker.addTrigger(new CellTrigger({ cells: [ - B5(-1, 0, -1, CELLSIZE), - B5(1, 0, -1, CELLSIZE), - B5(0, 0, -1, CELLSIZE), - B5(-1, 0, 0, CELLSIZE), - B5(1, 0, 0, CELLSIZE) - ], + [-1, 0, -1], + [1, 0, -1], + [0, 0, -1], + [-1, 0, 0], + [1, 0, 0] + ].map(([x4, y4, z4]) => B5(x4, y4, z4, CELLSIZE)), heroBox, blockImage: { outside: Assets.GROUND, @@ -52835,8 +52835,8 @@ class DemoGame extends AuxiliaryHolder { const factory = new FixedSpriteFactory({ cellSize: CELLSIZE }, [ f2.create().translate(-3.01, 0, 0).rotateY(Math.PI / 2), f2.create().translate(-3.01, 0, 0).rotateY(-Math.PI / 2), - f2.create().translate(3.01, 0, 0).rotateY(-Math.PI / 2), - f2.create().translate(3.01, 0, 0).rotateY(Math.PI / 2) + f2.create().translate(3.01, 0, 0).rotateY(Math.PI / 2), + f2.create().translate(3.01, 0, 0).rotateY(-Math.PI / 2) ].map((transform) => ({ imageId: Assets.LOGO, transform })), [ f2.create().translate(0, -0.9, 0).rotateX(-Math.PI / 2), f2.create().translate(0, -0.9, 2).rotateX(-Math.PI / 2), diff --git a/src/demo/DemoGame.ts b/src/demo/DemoGame.ts index a2c1552..6a4cd8d 100644 --- a/src/demo/DemoGame.ts +++ b/src/demo/DemoGame.ts @@ -535,20 +535,12 @@ export class DemoGame extends AuxiliaryHolder { cellTriggerTracker.addTrigger(new CellTrigger({ cells: [ - createCell(-1, 0, -1, CELLSIZE), - createCell(1, 0, -1, CELLSIZE), - createCell(0, 0, -1, CELLSIZE), - createCell(-1, 0, 0, CELLSIZE), - createCell(1, 0, 0, CELLSIZE), - ], - // cells: [ - // [-1, 0, -1], - // [1, 0, -1], - // [0, 0, -1], - // [-1, 0, 0], - // [1, 0, 0], - // ].map(([x, y, z]) => createCell(x, y, z, CELLSIZE)), - // cells: [createCell(-3, 0, -1, CELLSIZE)], + [-1, 0, -1], + [1, 0, -1], + [0, 0, -1], + [-1, 0, 0], + [1, 0, 0], + ].map(([x, y, z]) => createCell(x, y, z, CELLSIZE)), heroBox, blockImage: { outside: Assets.GROUND, @@ -568,8 +560,8 @@ export class DemoGame extends AuxiliaryHolder { [ Matrix.create().translate(-3.01, 0, 0).rotateY(Math.PI / 2), Matrix.create().translate(-3.01, 0, 0).rotateY(-Math.PI / 2), - Matrix.create().translate(3.01, 0, 0).rotateY(-Math.PI / 2), Matrix.create().translate(3.01, 0, 0).rotateY(Math.PI / 2), + Matrix.create().translate(3.01, 0, 0).rotateY(-Math.PI / 2), ].map(transform => ({ imageId: Assets.LOGO, transform })), // floor [ @@ -586,6 +578,19 @@ export class DemoGame extends AuxiliaryHolder { this.addAuxiliary(factory); } + // cellTriggerTracker.addTrigger(new CellTrigger({ + // cells: [ + // [0, 0, 0], + // [0, 0, 2], + // [-2, 0, 2], + // [2, 0, 2], + // ].map(([x, y, z]) => createCell(x, y, z, CELLSIZE)), + // heroBox, + // spriteImageId: Assets.GRASS_GROUND, + // worldColliders, + // spritesAccumulator, + // })); + const camPosition: IPositionMatrix = new PositionMatrix(); const camera: ICamera = this.camera = new Camera({ engine, motor, position: camPosition, diff --git a/src/index.tsx b/src/index.tsx index 4138b38..0004b6a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -43,7 +43,6 @@ export async function testCanvas(canvas: HTMLCanvasElement) { const world = new DemoGame({ engine, motor, - // ui: hud.ui, keyboard, controls: gameControls, });