Skip to content

Commit f047fe3

Browse files
fix: merge
2 parents bf1b654 + 5f81899 commit f047fe3

33 files changed

+16033
-16094
lines changed

examples/vanilla/phaser/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
206 Bytes
Loading
206 Bytes
Loading
253 Bytes
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import manifest from "../../dojo-starter/manifests/dev/deployment/manifest.json";
2+
import { createDojoConfig } from "@dojoengine/core";
3+
4+
export const dojoConfig = createDojoConfig({
5+
manifest,
6+
});
7+
export type Config = typeof dojoConfig;

examples/vanilla/phaser/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Dojo.js + Vanilla + Phaser example</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "phaser",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"devDependencies": {
12+
"typescript": "^5.5.4",
13+
"vite": "^5.3.5",
14+
"vite-plugin-top-level-await": "^1.4.2",
15+
"vite-plugin-wasm": "^3.3.0"
16+
},
17+
"dependencies": {
18+
"@dojoengine/core": "workspace:*",
19+
"@dojoengine/create-burner": "workspace:*",
20+
"@dojoengine/recs": "2.0.13",
21+
"@dojoengine/state": "workspace:*",
22+
"@dojoengine/torii-client": "workspace:*",
23+
"@dojoengine/utils": "workspace:*",
24+
"@latticexyz/utils": "^2.0.12",
25+
"noise": "^0.0.0",
26+
"phaser": "3.60.0-beta.14",
27+
"starknet": "6.11.0"
28+
}
29+
}
15 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { overridableComponent } from "@dojoengine/recs";
2+
import { ContractComponents } from "./defineContractComponents";
3+
4+
export type ClientComponents = ReturnType<typeof createClientComponents>;
5+
6+
export function createClientComponents({
7+
contractComponents,
8+
}: {
9+
contractComponents: ContractComponents;
10+
}) {
11+
return {
12+
...contractComponents,
13+
Position: overridableComponent(contractComponents.Position),
14+
Moves: overridableComponent(contractComponents.Moves),
15+
};
16+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* Autogenerated file. Do not edit manually. */
2+
3+
import { defineComponent, Type as RecsType, World } from "@dojoengine/recs";
4+
5+
export type ContractComponents = Awaited<
6+
ReturnType<typeof defineContractComponents>
7+
>;
8+
9+
export function defineContractComponents(world: World) {
10+
return {
11+
DirectionsAvailable: (() => {
12+
return defineComponent(
13+
world,
14+
{ player: RecsType.BigInt, directions: RecsType.StringArray },
15+
{
16+
metadata: {
17+
name: "dojo_starter-DirectionsAvailable",
18+
types: ["contractaddress"],
19+
customTypes: [],
20+
},
21+
}
22+
);
23+
})(),
24+
Moved: (() => {
25+
return defineComponent(
26+
world,
27+
{ player: RecsType.BigInt, direction: RecsType.Number },
28+
{
29+
metadata: {
30+
name: "dojo_starter-Moved",
31+
types: ["contractaddress", "enum"],
32+
customTypes: ["Direction"],
33+
},
34+
}
35+
);
36+
})(),
37+
Moves: (() => {
38+
return defineComponent(
39+
world,
40+
{
41+
player: RecsType.BigInt,
42+
remaining: RecsType.Number,
43+
last_direction: RecsType.Number,
44+
can_move: RecsType.Boolean,
45+
},
46+
{
47+
metadata: {
48+
name: "dojo_starter-Moves",
49+
types: ["contractaddress", "u8", "enum", "bool"],
50+
customTypes: ["Direction"],
51+
},
52+
}
53+
);
54+
})(),
55+
Position: (() => {
56+
return defineComponent(
57+
world,
58+
{
59+
player: RecsType.BigInt,
60+
vec: { x: RecsType.Number, y: RecsType.Number },
61+
},
62+
{
63+
metadata: {
64+
name: "dojo_starter-Position",
65+
types: ["contractaddress", "u32", "u32"],
66+
customTypes: ["Vec2"],
67+
},
68+
}
69+
);
70+
})(),
71+
};
72+
}

0 commit comments

Comments
 (0)