@rpgjs/tiledmap 5.0.0-alpha.9 → 5.0.0-beta.10
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/CHANGELOG.md +38 -0
- package/LICENSE +19 -0
- package/dist/client/client.d.ts +3 -0
- package/dist/client/compat.d.ts +19 -0
- package/dist/{index.d.ts → client/index.d.ts} +1 -1
- package/dist/client/index.js +35 -48
- package/dist/client/index2.js +3998 -6
- package/dist/client/index3.js +120 -4641
- package/dist/client/index4.js +64 -15
- package/dist/client/index5.js +11 -0
- package/dist/client/index6.js +22 -0
- package/dist/client/physics.d.ts +7 -0
- package/dist/server/compat.d.ts +19 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +12 -14
- package/dist/server/index2.js +3997 -93
- package/dist/server/index3.js +131 -5232
- package/dist/server/index4.js +93 -0
- package/dist/server/index5.js +15 -0
- package/dist/server/physics.d.ts +7 -0
- package/dist/server/server.d.ts +54 -0
- package/package.json +11 -11
- package/src/client.ts +9 -3
- package/src/compat.ts +221 -0
- package/src/index.ts +5 -1
- package/src/physics.spec.ts +285 -0
- package/src/physics.ts +171 -0
- package/src/server.ts +45 -152
- package/src/tiled.ce +5 -1
- package/dist/client.d.ts +0 -2
- package/dist/server.d.ts +0 -65
package/dist/server.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { RpgMap } from '@rpgjs/server';
|
|
2
|
-
import { MapClass } from '@canvasengine/tiled';
|
|
3
|
-
declare module "@rpgjs/server" {
|
|
4
|
-
interface RpgMap {
|
|
5
|
-
tiled?: MapClass;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Interface for an RpgMap extended with Tiled functionality
|
|
10
|
-
*
|
|
11
|
-
* @description This interface combines RpgMap with MapClass to enable
|
|
12
|
-
* the use of Tiled methods on RPG maps
|
|
13
|
-
*/
|
|
14
|
-
export interface RpgTiledMap extends RpgMap {
|
|
15
|
-
tiled: MapClass;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Tiled Module for RPGJS
|
|
19
|
-
*
|
|
20
|
-
* @description This module extends RPGJS maps with Tiled functionality,
|
|
21
|
-
* allowing TMX map parsing and automatic hitbox creation
|
|
22
|
-
* based on collisions defined in Tiled
|
|
23
|
-
*
|
|
24
|
-
* ## Features
|
|
25
|
-
*
|
|
26
|
-
* - **Automatic parsing**: Parses TMX files from Tiled Map Editor
|
|
27
|
-
* - **Collision detection**: Scans all tiles to detect collisions
|
|
28
|
-
* - **Hitbox creation**: Automatically generates hitboxes for each collision tile
|
|
29
|
-
* - **RpgMap extension**: Adds the `tiled` property to all RpgMap instances
|
|
30
|
-
*
|
|
31
|
-
* ## Usage
|
|
32
|
-
*
|
|
33
|
-
* Once this module is activated, you can use Tiled methods on your maps:
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* // In a map class
|
|
38
|
-
* class MyMap extends RpgMap {
|
|
39
|
-
* onLoad() {
|
|
40
|
-
* // Access Tiled functionality
|
|
41
|
-
* const tiles = this.tiled.getTileByPosition(100, 100);
|
|
42
|
-
*
|
|
43
|
-
* if (tiles.hasCollision) {
|
|
44
|
-
* console.log('This position has a collision');
|
|
45
|
-
* }
|
|
46
|
-
*
|
|
47
|
-
* // Iterate through all tiles by index
|
|
48
|
-
* for (let i = 0; i < this.tiled.width * this.tiled.height; i++) {
|
|
49
|
-
* const tileInfo = this.tiled.getTileByIndex(i);
|
|
50
|
-
* if (tileInfo.hasCollision) {
|
|
51
|
-
* console.log(`Tile ${i} has collision`);
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
*
|
|
55
|
-
* // Get information about a specific layer
|
|
56
|
-
* const layer = this.tiled.getLayerByName('Collision');
|
|
57
|
-
* if (layer) {
|
|
58
|
-
* console.log('Collision layer found:', layer);
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
declare const _default: any;
|
|
65
|
-
export default _default;
|