@rpgjs/tiledmap 5.0.0-alpha.8 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +3 -2
- package/dist/client/index2.js +7 -1
- package/dist/client/index3.js +586 -17
- package/dist/client/index4.js +4 -1
- package/dist/client/index5.js +50 -0
- package/dist/physics.d.ts +7 -0
- package/dist/server/index.js +1 -1
- package/dist/server/index2.js +6 -84
- package/dist/server/index3.js +7 -296
- package/dist/server/index4.js +72 -0
- package/dist/server.d.ts +0 -53
- package/package.json +11 -11
- package/src/client.ts +9 -3
- package/src/index.ts +5 -1
- package/src/physics.spec.ts +90 -0
- package/src/physics.ts +98 -0
- package/src/server.ts +6 -152
- package/src/tiled.ce +5 -1
package/dist/client/index.js
CHANGED
|
@@ -3,15 +3,15 @@ import { createModule } from "@rpgjs/common";
|
|
|
3
3
|
import { provideLoadMap } from "@rpgjs/client";
|
|
4
4
|
import { TiledParser } from "./index3.js";
|
|
5
5
|
import component from "./index4.js";
|
|
6
|
+
import { prepareTiledPhysicsData } from "./index5.js";
|
|
6
7
|
const server = null;
|
|
7
8
|
function provideTiledMap(options) {
|
|
8
|
-
var _a;
|
|
9
9
|
return createModule("TiledMap", [
|
|
10
10
|
{
|
|
11
11
|
server,
|
|
12
12
|
client
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
provideLoadMap?.(async (map) => {
|
|
15
15
|
const response = await fetch(`${options.basePath}/${map}.tmx`);
|
|
16
16
|
const mapData = await response.text();
|
|
17
17
|
const parser = new TiledParser(mapData);
|
|
@@ -40,6 +40,7 @@ function provideTiledMap(options) {
|
|
|
40
40
|
basePath: options.basePath
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
+
prepareTiledPhysicsData(obj, obj);
|
|
43
44
|
if (options.onLoadMap) {
|
|
44
45
|
await options.onLoadMap(map);
|
|
45
46
|
}
|
package/dist/client/index2.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { defineModule } from "@rpgjs/common";
|
|
2
|
+
import { prepareTiledPhysicsData } from "./index5.js";
|
|
2
3
|
const client = defineModule({
|
|
3
|
-
|
|
4
|
+
componentAnimations: [],
|
|
5
|
+
sceneMap: {
|
|
6
|
+
onPhysicsInit(map, context) {
|
|
7
|
+
prepareTiledPhysicsData(context?.mapData, map);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
4
10
|
});
|
|
5
11
|
export {
|
|
6
12
|
client as default
|