Skip to content

Commit

Permalink
phaser
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Jan 10, 2024
1 parent 6f7c7bb commit 368175e
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const createPhaserLayer = async (
networkLayer: NetworkLayer,
phaserConfig: PhaserEngineConfig
) => {
const world = namespaceWorld(networkLayer.world, "phaser");
const world = namespaceWorld(networkLayer.recsWorld, "phaser");
const {
game,
scenes,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PhaserLayer } from "..";
import { PhaserLayer } from "../createPhaserLayer";

export const camera = (layer: PhaserLayer) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PhaserLayer } from "..";
import { PhaserLayer } from "../createPhaserLayer";
import { Direction } from "../../dojo/utils";

export const controls = (layer: PhaserLayer) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tileset } from "../../assets/world";
import { PhaserLayer } from "..";
import { PhaserLayer } from "../createPhaserLayer";
import { snoise } from "@dojoengine/utils";
import { MAP_AMPLITUDE } from "../config/constants";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
defineEnterSystem,
getComponentValueStrict,
} from "@dojoengine/recs";
import { PhaserLayer } from "..";
import { PhaserLayer } from "../createPhaserLayer";
import { tileCoordToPixelCoord } from "@latticexyz/phaserx";
import { Animations, TILE_HEIGHT, TILE_WIDTH } from "../config/constants";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PhaserLayer } from "..";
import { PhaserLayer } from "../createPhaserLayer";
import { move } from "./move";
import { controls } from "./controls";
import { mapSystem } from "./mapSystem";
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-phaser-example/src/store.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { create } from "zustand";
import { NetworkLayer } from "./dojo/createNetworkLayer";
import { PhaserLayer } from "./phaser";
import { PhaserLayer } from "./phaser/createPhaserLayer";

export type Store = {
networkLayer: NetworkLayer | null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { createPhaserLayer } from "../../phaser";
import { createPhaserLayer } from "../../phaser/createPhaserLayer";
import { NetworkLayer } from "../../dojo/createNetworkLayer";
import { phaserConfig } from "../../phaser/config/configurePhaser";
import { usePromiseValue } from "./usePromiseValue";
Expand Down
10 changes: 6 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ git submodule update --init --recursive

---

### Examples
### Debugging

If you have issues on WSL, install package first then run command :
If you have issues on WSL, install package first then run command:

```console
npm i @dojoengine/create-dojo -g
npx @dojoengine/create-dojo
```

### Examples

To run the examples that have the linked packages, follow the steps below:

**Terminal 1**: Set up the dojo starter with specific configurations.
Expand All @@ -104,6 +106,6 @@ sozo migrate

```console
cd examples/<package>
bun install
bun dev
pnpm install
pnpm run dev
```

0 comments on commit 368175e

Please sign in to comment.