Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklehamster committed Apr 11, 2024
1 parent fe3a9b7 commit 2e2ce46
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
16 changes: 8 additions & 8 deletions example/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand Down
35 changes: 20 additions & 15 deletions src/demo/DemoGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
[
Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export async function testCanvas(canvas: HTMLCanvasElement) {
const world = new DemoGame({
engine,
motor,
// ui: hud.ui,
keyboard,
controls: gameControls,
});
Expand Down

0 comments on commit 2e2ce46

Please sign in to comment.