diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..41e779c --- /dev/null +++ b/.npmignore @@ -0,0 +1,14 @@ +.* +src +test +node_modules +coverage +example +node_cache/* +test +test-results +playwright-report +readme/* +!dist/* +**/webpack.config.js +**/webpack.config.test.js \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..436d5c5 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18.19.0 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5d6345c..03f3a49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "@excaliburjs/plugin-ldtk", - "version": "1.0.0", + "version": "0.28.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@excaliburjs/plugin-ldtk", - "version": "1.0.0", - "license": "ISC", + "version": "0.28.7", + "license": "BSD-2-Clause", "dependencies": { "compare-versions": "6.1.0", "zod": "3.22.4" }, "devDependencies": { - "excalibur": "~0.28.6", + "excalibur": "~0.28.7", "raw-loader": "4.0.2", "ts-loader": "9.5.0", "typescript": "5.2.2", @@ -22,7 +22,7 @@ "webpack-dev-server": "4.15.1" }, "peerDependencies": { - "excalibur": "~0.28.6" + "excalibur": "~0.28.7" } }, "node_modules/@discoveryjs/json-ext": { @@ -1271,9 +1271,9 @@ } }, "node_modules/excalibur": { - "version": "0.28.6", - "resolved": "https://registry.npmjs.org/excalibur/-/excalibur-0.28.6.tgz", - "integrity": "sha512-1EZGa7LPC1Ad+BsbvPXzz+l59DV6IkFDdat/Uc0V7bZl05rftpIZkBuJ8Mb5+juHq+0T921clg5tmlQX/bZ/BQ==", + "version": "0.28.7", + "resolved": "https://registry.npmjs.org/excalibur/-/excalibur-0.28.7.tgz", + "integrity": "sha512-ws4hT4xE4+EaICdxHvI9pZV3L+RdtJK+H36KUfCoYQK3uaZNlnIO4JoeqMvKYbcCOZybKzW73W9+DyIjAiBvnA==", "dev": true, "dependencies": { "core-js": "3.33.3" @@ -4825,9 +4825,9 @@ "dev": true }, "excalibur": { - "version": "0.28.6", - "resolved": "https://registry.npmjs.org/excalibur/-/excalibur-0.28.6.tgz", - "integrity": "sha512-1EZGa7LPC1Ad+BsbvPXzz+l59DV6IkFDdat/Uc0V7bZl05rftpIZkBuJ8Mb5+juHq+0T921clg5tmlQX/bZ/BQ==", + "version": "0.28.7", + "resolved": "https://registry.npmjs.org/excalibur/-/excalibur-0.28.7.tgz", + "integrity": "sha512-ws4hT4xE4+EaICdxHvI9pZV3L+RdtJK+H36KUfCoYQK3uaZNlnIO4JoeqMvKYbcCOZybKzW73W9+DyIjAiBvnA==", "dev": true, "requires": { "core-js": "3.33.3" diff --git a/src/filter-util.ts b/src/filter-util.ts deleted file mode 100644 index a3fdffa..0000000 --- a/src/filter-util.ts +++ /dev/null @@ -1,26 +0,0 @@ - -// export const byNameCaseInsensitive = (name?: string) => { -// return (object: TObject) => { -// if (object?.name && name) { -// return object.name.toLocaleLowerCase().localeCompare(name.toLocaleLowerCase()) === 0; -// } -// return object?.name === name; -// } -// } - -// export const byPropertyCaseInsensitive = (propertyName: string, value?: any) => { -// return }>(object: TObject) => { -// const lowercase = copyPropsLowerCase(object.properties); - -// if (value !== undefined) { -// let normalizedValue = value; -// if (typeof value === 'string') { -// normalizedValue = value.toLocaleLowerCase(); -// } - -// return lowercase.get(propertyName.toLocaleLowerCase()) === normalizedValue; -// } else { -// return lowercase.has(propertyName.toLocaleLowerCase()); -// } -// } -// } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 9b91aff..0013101 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,12 @@ -export * from './ldtk-resource'; \ No newline at end of file +export * from './ldtk-resource'; +export * from './entity-layer'; +export * from './file-loader'; +export * from './intgrid-layer'; +export * from './level-resource'; +export * from './level'; +export * from './loader-cache'; +export * from './path-util'; +export * from './tile-layer'; +export * from './tileset'; +export * from './types'; \ No newline at end of file diff --git a/src/ldtk-resource.ts b/src/ldtk-resource.ts index b85b49a..a90163a 100644 --- a/src/ldtk-resource.ts +++ b/src/ldtk-resource.ts @@ -73,21 +73,19 @@ export interface LdtkResourceOptions { * Default true. If false, only tilemap will be parsed and displayed, it's up to you to wire up any excalibur behavior. * Automatically wires excalibur to the following * * Wire up current scene camera - * * Make Actors/Tiles with colliders on Tiled tiles & Tiled objects - * * Support solid layers * * Read more at excaliburjs.com! */ useExcaliburWiring?: boolean; /** - * Sets excalibur's background color to match the Tiled map + * Sets excalibur's background color to match the LDtk map */ useMapBackgroundColor?: boolean; /** * The pathMap helps work around odd things bundlers do with static files by providing a way to redirect the original - * source paths in the Tiled files to new locations. + * source paths in the LDtk files to new locations. * * When the LDtk resource comes across something that matches `path`, it will use the output string instead. * @@ -113,16 +111,16 @@ export interface LdtkResourceOptions { fileLoader?: FileLoader; /** - * By default `true`, means Tiled files must pass the plugins Typed parse pass. + * By default `true`, means LDtk files must pass the plugins Typed parse pass. * - * If you have something that the Tiled plugin does not expect, you can set this to false and it will do it's best - * to parse the Tiled source map file. + * If you have something that the LDtk plugin does not expect, you can set this to false and it will do it's best + * to parse the LDtk source map file. */ strict?: boolean; /** * Plugin will operate in headless mode and skip all graphics related - * excalibur items including creating ImageSource's for Tiled items. + * excalibur items including creating ImageSource's for LDtk items. * * Default false. */ @@ -207,7 +205,7 @@ export class LdtkResource implements Loadable { } if (compare(LdtkResource.supportedLdtkVersion, this.projectMetadata.jsonVersion ?? '0.0.0', ">")) { - console.warn(`The excalibur tiled plugin officially supports ${LdtkResource.supportedLdtkVersion}+, the current map has LDtk version ${this.projectMetadata.jsonVersion}`) + console.warn(`The excalibur ldtk plugin officially supports ${LdtkResource.supportedLdtkVersion}+, the current map has LDtk version ${this.projectMetadata.jsonVersion}`) } // iterate through the defs diff --git a/todos.md b/todos.md deleted file mode 100644 index cb6f68d..0000000 --- a/todos.md +++ /dev/null @@ -1,25 +0,0 @@ - - -## Part 1 -Load an LDtk project file into excalibur - -Load phase -* Point at a *.ldtk file (excalibur resource) -* Load/specify a level interested -* Locate the tileset images and load those - -Parse phase -* Iterate through the current level - - Build excalibur TileMaps using the appropriate level.ldtkl - -## Part 2 - -* Parse entities - - [x] Create a default actor (named with the identifyer) - - [x] Position with the pixel position - - [ ] Add some smarts to parse tags to inform excalibur about actor option -* [x] Move entities -* Parse integer layers - - [x] Add colliders -* New Level? -