diff --git a/CHANGELOG.md b/CHANGELOG.md index 3391ffdf3..3c1004e03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Fixed issue where parenting a entity with fixed updates on would cause a drawing flicker, transform interpolation now is aware of changing parents so it interpolates drawing continuously to prevent any flickering - `ex.Animation.reset()` did not properly reset all internal state ### Updates diff --git a/package.json b/package.json index 9391e8b86..9d9a96ad4 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "browserstack": "karma start karma.conf.browsers.js", "nuget": ".\\src\\tools\\NuGet.exe pack Excalibur.nuspec -OutputDirectory .\\build\\nuget -version", "start": "npm run core:watch", + "start:esm": "npm run core:bundle:esm -- --watch", "build": "npm run core", "build:esm": "npm run core:bundle:esm", "core": "npm run core:tsc && npm run core:copy && npm run core:bundle", diff --git a/src/engine/Collision/BodyComponent.ts b/src/engine/Collision/BodyComponent.ts index 6311bd3d3..67b56065d 100644 --- a/src/engine/Collision/BodyComponent.ts +++ b/src/engine/Collision/BodyComponent.ts @@ -427,7 +427,9 @@ export class BodyComponent extends Component<'ex.body'> implements Clonable -1) { @@ -219,6 +219,11 @@ export class Transform { this.flagDirty(); } + /** + * Clones the current transform + * **Warning does not clone the parent** + * @param dest + */ public clone(dest?: Transform) { const target = dest ?? new Transform(); this._pos.clone(target._pos); diff --git a/src/spec/GraphicsSystemSpec.ts b/src/spec/GraphicsSystemSpec.ts index 369b38b01..013264c24 100644 --- a/src/spec/GraphicsSystemSpec.ts +++ b/src/spec/GraphicsSystemSpec.ts @@ -154,7 +154,7 @@ describe('A Graphics ECS System', () => { actor.body.__oldTransformCaptured = true; - spyOn(game.graphicsContext, 'translate'); + const translateSpy = spyOn(game.graphicsContext, 'translate'); spyOn(game.graphicsContext, 'rotate'); spyOn(game.graphicsContext, 'scale'); @@ -163,10 +163,11 @@ describe('A Graphics ECS System', () => { graphicsSystem.preupdate(); graphicsSystem.notify(new ex.AddedEntity(actor)); - game.currentFrameLagMs = 8; // current lag in a 30 fps frame - graphicsSystem.update([actor], 30); + game.currentFrameLagMs = (1000 / 30) / 2; // current lag in a 30 fps frame + graphicsSystem.update([actor], 16); - expect(game.graphicsContext.translate).toHaveBeenCalledWith(24, 24); + expect(translateSpy.calls.argsFor(0)).toEqual([10, 10]); + expect(translateSpy.calls.argsFor(1)).toEqual([45, 45]); // 45 because the parent offets by (-10, -10) }); it('will not interpolate body graphics if disabled', async () => { diff --git a/wallaby.js b/wallaby.js index 5bbc9d3ef..2bc66a9c8 100644 --- a/wallaby.js +++ b/wallaby.js @@ -31,6 +31,9 @@ module.exports = function (wallaby) { postprocessor: wallaby.postprocessors.webpack({ mode: 'none', devtool: 'source-map', + optimization: { + providedExports: true, + }, resolve: { extensions: ['.ts', '.js'], alias: {