excalibur 0.32.0-alpha.1587 → 0.32.0-alpha.1589
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/build/dist/excalibur.development.js +2 -2
- package/build/dist/excalibur.js +2 -2
- package/build/dist/excalibur.min.development.js +2 -2
- package/build/dist/excalibur.min.js +2 -2
- package/build/esm/excalibur.development.js +2 -2
- package/build/esm/excalibur.js +2 -2
- package/build/esm/excalibur.min.development.js +2 -2
- package/build/esm/excalibur.min.js +2 -2
- package/package.json +2 -2
- package/vitest.config.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -33466,7 +33466,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`
|
|
|
33466
33466
|
this._count += count;
|
|
33467
33467
|
}
|
|
33468
33468
|
}
|
|
33469
|
-
const EX_VERSION = "0.32.0-alpha.
|
|
33469
|
+
const EX_VERSION = "0.32.0-alpha.1589+bc6ab76";
|
|
33470
33470
|
polyfill();
|
|
33471
33471
|
exports2.ActionCompleteEvent = ActionCompleteEvent;
|
|
33472
33472
|
exports2.ActionContext = ActionContext;
|
package/build/dist/excalibur.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -33466,7 +33466,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`
|
|
|
33466
33466
|
this._count += count;
|
|
33467
33467
|
}
|
|
33468
33468
|
}
|
|
33469
|
-
const EX_VERSION = "0.32.0-alpha.
|
|
33469
|
+
const EX_VERSION = "0.32.0-alpha.1589+bc6ab76";
|
|
33470
33470
|
polyfill();
|
|
33471
33471
|
exports2.ActionCompleteEvent = ActionCompleteEvent;
|
|
33472
33472
|
exports2.ActionContext = ActionContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -928,4 +928,4 @@ If in Firefox, visit about:config
|
|
|
928
928
|
|
|
929
929
|
Read more about this issue at https://excaliburjs.com/docs/performance`),i&&this._toaster.toast("Excalibur is encountering performance issues. It's possible that your browser doesn't have hardware acceleration enabled. Visit [LINK] for more information and potential solutions.","https://excaliburjs.com/docs/performance"),this.useCanvas2DFallback(),this.emit("fallbackgraphicscontext",this.graphicsContext))}}useCanvas2DFallback(){var t,e,i;const s=this.canvas.cloneNode(!1);this.canvas.parentNode.replaceChild(s,this.canvas),this.canvas=s;const n={...this._originalOptions,antialiasing:this.screen.antialiasing},o=this._originalDisplayMode;this.graphicsContext=new Yi({canvasElement:this.canvas,enableTransparency:this.enableCanvasTransparency,antialiasing:n.antialiasing,backgroundColor:n.backgroundColor,snapToPixel:n.snapToPixel,useDrawSorting:n.useDrawSorting}),this.screen&&this.screen.dispose(),this.screen=new kn({canvas:this.canvas,context:this.graphicsContext,antialiasing:(t=n.antialiasing)!=null?t:!0,browser:this.browser,viewport:(e=n.viewport)!=null?e:n.width&&n.height?{width:n.width,height:n.height}:Bn.SVGA,resolution:n.resolution,displayMode:o,pixelRatio:n.suppressHiDPIScaling?1:(i=n.pixelRatio)!=null?i:null}),this.screen.setCurrentCamera(this.currentScene.camera),this.input.pointers.detach();const a=n&&n.pointerScope===Be.Document?document:this.canvas;this.input.pointers=this.input.pointers.recreate(a,this),this.input.pointers.init()}dispose(){this._disposed||(this._disposed=!0,this.stop(),this._garbageCollector.forceCollectAll(),this.input.toggleEnabled(!1),this._hasCreatedCanvas&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null,this.screen.dispose(),this.graphicsContext.dispose(),this.graphicsContext=null,_e.InstanceCount--)}isDisposed(){return this._disposed}getWorldBounds(){return this.screen.getWorldBounds()}get timescale(){return this._timescale}set timescale(t){if(t<0){R.getInstance().warnOnce("engine.timescale to a value less than 0 are ignored");return}this._timescale=t}addTimer(t){return this.currentScene.addTimer(t)}removeTimer(t){return this.currentScene.removeTimer(t)}addScene(t,e){return this.director.add(t,e),this}removeScene(t){this.director.remove(t)}add(t){if(arguments.length===2){this.director.add(arguments[0],arguments[1]);return}const e=this.director.getDeferredScene();e instanceof Mt?e.add(t):this.currentScene.add(t)}remove(t){t instanceof At&&this.currentScene.remove(t),(t instanceof Mt||jt(t))&&this.removeScene(t),typeof t=="string"&&this.removeScene(t)}async goToScene(t,e){await this.scope(async()=>{await this.director.goToScene(t,e)})}screenToWorldCoordinates(t){return this.screen.screenToWorldCoordinates(t)}worldToScreenCoordinates(t){return this.screen.worldToScreenCoordinates(t)}_initialize(t){var e,i;this.pageScrollPreventionMode=t.scrollPreventionMode;const s=t&&t.pointerScope===Be.Document?document:this.canvas,n=(i=(e=this._originalOptions)==null?void 0:e.grabWindowFocus)!=null?i:!0;this.input=new Yn({global:this.global,pointerTarget:s,grabWindowFocus:n,engine:this}),this.inputMapper=this.input.inputMapper,this.browser.document.on("visibilitychange",()=>{document.visibilityState==="hidden"?(this.events.emit("hidden",new Ws(this)),this._logger.debug("Window hidden")):document.visibilityState==="visible"&&(this.events.emit("visible",new Ns(this)),this._logger.debug("Window visible"))}),!this.canvasElementId&&!t.canvasElement&&document.body.appendChild(this.canvas)}toggleInputEnabled(t){this._inputEnabled=t,this.input.toggleEnabled(this._inputEnabled)}onInitialize(t){}get isInitialized(){return this._isInitialized}async _overrideInitialize(t){this.isInitialized||(await this.director.onInitialize(),await this.onInitialize(t),this.events.emit("initialize",new Oe(t,this)),this._isInitialized=!0)}_update(t){var e;if(this._isLoading){(e=this._loader)==null||e.onUpdate(this,t),this.input.update();return}this.clock.__runScheduledCbs("preupdate"),this._preupdate(t),this.currentScene.update(this,t),this.graphicsContext.updatePostProcessors(t),this.clock.__runScheduledCbs("postupdate"),this._postupdate(t),this.input.update()}_preupdate(t){this.emit("preupdate",new re(this,t,this)),this.onPreUpdate(this,t)}onPreUpdate(t,e){}_postupdate(t){this.emit("postupdate",new oe(this,t,this)),this.onPostUpdate(this,t)}onPostUpdate(t,e){}_draw(t){var e,i;if(this.graphicsContext.backgroundColor=(e=this.currentScene.backgroundColor)!=null?e:this.backgroundColor,this.graphicsContext.beginDrawLifecycle(),this.graphicsContext.clear(),this.clock.__runScheduledCbs("predraw"),this._predraw(this.graphicsContext,t),this._isLoading){this._hideLoader||((i=this._loader)==null||i.canvas.draw(this.graphicsContext,0,0),this.clock.__runScheduledCbs("postdraw"),this.graphicsContext.flush(),this.graphicsContext.endDrawLifecycle());return}this.currentScene.draw(this.graphicsContext,t),this.clock.__runScheduledCbs("postdraw"),this._postdraw(this.graphicsContext,t),this.graphicsContext.flush(),this.graphicsContext.endDrawLifecycle(),this._checkForScreenShots()}_predraw(t,e){this.emit("predraw",new ze(t,e,this)),this.onPreDraw(t,e)}onPreDraw(t,e){}_postdraw(t,e){this.emit("postdraw",new Ue(t,e,this)),this.onPostDraw(t,e)}onPostDraw(t,e){}showDebug(t){this._isDebug=t}toggleDebug(){return this._isDebug=!this._isDebug,this._isDebug}get loadingComplete(){return!this._isLoading}get ready(){return this._isReadyFuture.isCompleted}isReady(){return this._isReadyFuture.promise}async start(t,e){await this.scope(async()=>{if(!this._compatible)throw new Error("Excalibur is incompatible with your browser");this._isLoading=!0;let i;return t instanceof mi?i=t:typeof t=="string"&&(this.director.configureStart(t,e),i=this.director.mainLoader),this._logger.debug("Starting game clock..."),this.browser.resume(),this.clock.start(),this.garbageCollectorConfig&&this._garbageCollector.start(),this._logger.debug("Game clock started"),await this.load(i!=null?i:new Ki),await this._overrideInitialize(this),this._isReadyFuture.resolve(),this.emit("start",new Is(this)),this._isReadyFuture.promise})}_mainloop(t){this.scope(()=>{this.emit("preframe",new ks(this,this.stats.prevFrame));const e=t*this.timescale;this.currentFrameElapsedMs=e;const i=this.stats.prevFrame.id+1;this.stats.currFrame.reset(),this.stats.currFrame.id=i,this.stats.currFrame.elapsedMs=e,this.stats.currFrame.fps=this.clock.fpsSampler.fps,J.clear();const s=this.clock.now(),n=this.fixedUpdateTimestep;if(this.fixedUpdateTimestep)for(this._lagMs+=e;this._lagMs>=n;)this._update(n),this._lagMs-=n;else this._update(e);const o=this.clock.now();this.currentFrameLagMs=this._lagMs,this._draw(e);const a=this.clock.now();this.stats.currFrame.duration.update=o-s,this.stats.currFrame.duration.draw=a-o,this.stats.currFrame.graphics.drawnImages=J.DrawnImagesCount,this.stats.currFrame.graphics.drawCalls=J.DrawCallCount,this.emit("postframe",new Ls(this,this.stats.currFrame)),this.stats.prevFrame.reset(this.stats.currFrame),this._monitorPerformanceThresholdAndTriggerFallback()})}stop(){this.clock.isRunning()&&(this.emit("stop",new Rs(this)),this.browser.pause(),this.clock.stop(),this._garbageCollector.stop(),this._logger.debug("Game stopped"))}isRunning(){return this.clock.isRunning()}screenshot(t=!1){return new Promise(i=>{this._screenShotRequests.push({preserveHiDPIResolution:t,resolve:i})})}_checkForScreenShots(){for(const t of this._screenShotRequests){const e=t.preserveHiDPIResolution?this.canvas.width:this.screen.resolution.width,i=t.preserveHiDPIResolution?this.canvas.height:this.screen.resolution.height,s=document.createElement("canvas");s.width=e,s.height=i;const n=s.getContext("2d");n.imageSmoothingEnabled=this.screen.antialiasing,n.drawImage(this.canvas,0,0,e,i);const o=new Image,a=s.toDataURL("image/png");o.onload=()=>{t.resolve(o)},o.src=a}this._screenShotRequests.length=0}async load(t,e=!1){await this.scope(async()=>{try{if(t.isLoaded())return;this._loader=t,this._isLoading=!0,this._hideLoader=e,t instanceof Ki&&(t.suppressPlayButton=t.suppressPlayButton||this._suppressPlayButton),this._loader.onInitialize(this),await t.load()}catch(i){this._logger.error("Error loading resources, things may not behave properly",i),await Promise.resolve()}finally{this._isLoading=!1,this._hideLoader=!1,this._loader=null}})}};os.Context=ma(),os.InstanceCount=0,os._DEFAULT_ENGINE_OPTIONS={width:0,height:0,enableCanvasTransparency:!0,useDrawSorting:!0,configurePerformanceCanvas2DFallback:{allow:!1,showPlayerMessage:!1,threshold:{fps:20,numberOfFrames:100}},canvasElementId:"",canvasElement:void 0,enableCanvasContextMenu:!1,snapToPixel:!1,antialiasing:!0,pixelArt:!1,garbageCollection:!0,powerPreference:"high-performance",pointerScope:Be.Canvas,suppressConsoleBootMessage:null,suppressMinimumBrowserFeatureDetection:null,suppressHiDPIScaling:null,suppressPlayButton:null,grabWindowFocus:!0,scrollPreventionMode:1,backgroundColor:T.fromHex("#2185d0")};let as=os;class Xl extends kt{constructor(t){super(t),this._font=new Se,this._text=new _i({text:"",font:this._font});const{text:e,pos:i,x:s,y:n,spriteFont:o,font:a,color:h,maxWidth:l}={text:"",...t};this.pos=i!=null?i:s&&n?b(s,n):this.pos,this.text=e!=null?e:this.text,this.font=a!=null?a:this.font,this.maxWidth=l!=null?l:this.maxWidth,this.spriteFont=o!=null?o:this.spriteFont,this._text.color=h!=null?h:this.color;const c=this.get(K);c.anchor=w.Zero,c.use(this._text)}set maxWidth(t){this._text.maxWidth=t}get maxWidth(){return this._text.maxWidth}get font(){return this._font}set font(t){this._font=t,this._text.font=t}get text(){return this._text.text}set text(t){this._text.text=t}get color(){return this._text.color}set color(t){this._text&&(this._text.color=t)}get opacity(){return this.graphics.opacity}set opacity(t){this.graphics.opacity=t}get spriteFont(){return this._spriteFont}set spriteFont(t){t&&(this._spriteFont=t,this._text.font=this._spriteFont)}_initialize(t){super._initialize(t)}getTextWidth(){return this._text.width}}var Ee=(r=>(r.Circle="circle",r.Rectangle="rectangle",r))(Ee||{});class Yl extends kt{constructor(t){var e,i;super({width:(e=t.width)!=null?e:0,height:(i=t.height)!=null?i:0}),this._particlesToEmit=0,this._particlePool=new qe(()=>new $i({}),m=>m,500),this.numParticles=0,this.isEmitting=!0,this.deadParticles=[],this.emitRate=1,this.emitterType=Ee.Rectangle,this.radius=0,this.particle={life:2e3,transform:Xt.Global,graphic:void 0,opacity:1,angularVelocity:0,focus:void 0,focusAccel:void 0,randomRotation:!1},this._activeParticles=[];const{particle:s,x:n,y:o,z:a,pos:h,isEmitting:l,emitRate:c,emitterType:u,radius:_,random:f}={...t};this.particle={...this.particle,...s},this.pos=h!=null?h:b(n!=null?n:0,o!=null?o:0),this.z=a!=null?a:0,this.isEmitting=l!=null?l:this.isEmitting,this.emitRate=c!=null?c:this.emitRate,this.emitterType=u!=null?u:this.emitterType,this.radius=_!=null?_:this.radius,this.body.collisionType=M.PreventCollision,this.random=f!=null?f:new se}removeParticle(t){this.deadParticles.push(t)}emitParticles(t){var e;if(!(t<=0)){t=t|0;for(let i=0;i<t;i++){const s=this._createParticle();(e=this==null?void 0:this.scene)!=null&&e.world&&(this.particle.transform===Xt.Global?this.scene.world.add(s):this.addChild(s)),this._activeParticles.push(s)}}}clearParticles(){for(let t=0;t<this._activeParticles.length;t++)this.removeParticle(this._activeParticles[t])}_createParticle(){let t=0,e=0;const i=Nt(this.particle.minAngle||0,this.particle.maxAngle||Math.PI*2,this.random),s=Nt(this.particle.minSpeed||0,this.particle.maxSpeed||0,this.random),n=this.particle.startSize||Nt(this.particle.minSize||5,this.particle.maxSize||5,this.random),o=s*Math.cos(i),a=s*Math.sin(i);if(this.emitterType===Ee.Rectangle)t=Nt(0,this.width,this.random),e=Nt(0,this.height,this.random);else if(this.emitterType===Ee.Circle){const l=Nt(0,this.radius,this.random);t=l*Math.cos(i),e=l*Math.sin(i)}const h=this._particlePool.rent();return h.unparent(),h.configure({transform:this.particle.transform,life:this.particle.life,opacity:this.particle.opacity,beginColor:this.particle.beginColor,endColor:this.particle.endColor,pos:b(t,e),z:this.particle.transform===Xt.Global?this.z:void 0,vel:b(o,a),acc:this.particle.acc,angularVelocity:this.particle.angularVelocity,startSize:this.particle.startSize,endSize:this.particle.endSize,size:n,graphic:this.particle.graphic,fade:this.particle.fade}),h.registerEmitter(this),this.particle.randomRotation&&(h.transform.rotation=Nt(0,Math.PI*2,this.random)),this.particle.focus&&(h.focus=this.particle.focus.add(b(this.pos.x,this.pos.y)),h.focusAccel=this.particle.focusAccel),h}update(t,e){var i;super.update(t,e),this.isEmitting&&(this._particlesToEmit+=this.emitRate*(e/1e3),this._particlesToEmit>1&&(this.emitParticles(Math.floor(this._particlesToEmit)),this._particlesToEmit=this._particlesToEmit-Math.floor(this._particlesToEmit)));for(let s=0;s<this.deadParticles.length;s++){(i=this==null?void 0:this.scene)!=null&&i.world&&(this.scene.world.remove(this.deadParticles[s],!1),this._particlePool.return(this.deadParticles[s]));const n=this._activeParticles.indexOf(this.deadParticles[s]);n>-1&&this._activeParticles.splice(n,1)}this.deadParticles.length=0}}function Jn(r,t){if(!t())throw new Error(r)}class hs{constructor(t,e,i){this.emitRate=1,this._initialized=!1,this._vaos=[],this._buffers=[],this._drawIndex=0,this._numInputFloats=7,this._particleIndex=0,this._uploadIndex=0,this._wrappedLife=0,this._wrappedParticles=0,this._particleLife=0,this._clearRequested=!1,this._emitted=[];var s;this.emitter=t,this.particle=i,this._particleData=new Float32Array(this.emitter.maxParticles*this._numInputFloats),this._random=e,this._particleLife=(s=this.particle.life)!=null?s:2e3}get isInitialized(){return this._initialized}get maxParticles(){return this.emitter.maxParticles}initialize(t,e){if(this._initialized)return;const i=this.emitter.maxParticles,s=this._numInputFloats,n=this._particleData,o=4,a=t.createBuffer(),h=t.createVertexArray();t.bindVertexArray(h),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,i*s*o,t.DYNAMIC_DRAW),t.bufferSubData(t.ARRAY_BUFFER,0,n);let l=0;t.vertexAttribPointer(0,2,t.FLOAT,!1,s*o,0),l+=o*2,t.vertexAttribPointer(1,2,t.FLOAT,!1,s*o,l),l+=o*2,t.vertexAttribPointer(2,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(3,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(4,1,t.FLOAT,!1,s*o,l),l+=o*1,t.enableVertexAttribArray(0),t.enableVertexAttribArray(1),t.enableVertexAttribArray(2),t.enableVertexAttribArray(3),t.enableVertexAttribArray(4),this._vaos.push(h),this._buffers.push(a),t.bindVertexArray(null),t.bindBuffer(t.ARRAY_BUFFER,null);const c=t.createBuffer(),u=t.createVertexArray();t.bindVertexArray(u),t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,i*s*o,t.DYNAMIC_DRAW),l=0,t.vertexAttribPointer(0,2,t.FLOAT,!1,s*o,0),l+=o*2,t.vertexAttribPointer(1,2,t.FLOAT,!1,s*o,l),l+=o*2,t.vertexAttribPointer(2,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(3,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(4,1,t.FLOAT,!1,s*o,l),l+=o*1,t.enableVertexAttribArray(0),t.enableVertexAttribArray(1),t.enableVertexAttribArray(2),t.enableVertexAttribArray(3),t.enableVertexAttribArray(4),this._vaos.push(u),this._buffers.push(c),t.bindVertexArray(null),t.bindBuffer(t.ARRAY_BUFFER,null),this._currentVao=this._vaos[this._drawIndex%2],this._currentBuffer=this._buffers[(this._drawIndex+1)%2],this._initialized=!0}clearParticles(){this._particleData.fill(0),this._clearRequested=!0}emitParticles(t){const e=this._particleIndex,i=this.maxParticles*this._numInputFloats,s=t*this._numInputFloats+e;for(let n=e;n<s;n+=this._numInputFloats){let o=this._random.floating(this.particle.minAngle||0,this.particle.maxAngle||it);o+=this.particle.transform===Xt.Local?this.emitter.transform.rotation:this.emitter.transform.globalRotation;const a=this._random.floating(this.particle.minSpeed||0,this.particle.maxSpeed||0),h=this._random.floating(this.particle.minSpeed||0,this.particle.maxSpeed||0),l=a*Math.cos(o),c=h*Math.sin(o);let u=0,_=0;if(this.emitter.emitterType===Ee.Rectangle)u=this._random.floating(-.5,.5)*this.emitter.width,_=this._random.floating(-.5,.5)*this.emitter.height;else{const p=this._random.floating(0,this.emitter.radius);u=p*Math.cos(o),_=p*Math.sin(o)}const f=this.emitter.transform.apply(b(u,_)),m=[this.particle.transform===Xt.Local?u:f.x,this.particle.transform===Xt.Local?_:f.y,l,c,this.particle.randomRotation?Nt(0,it,this._random):this.particle.rotation||0,this.particle.angularVelocity||0,this._particleLife];this._particleData.set(m,n%this._particleData.length)}s>=i?(this._wrappedParticles+=(s-i)/this._numInputFloats,this._wrappedLife=this._particleLife):this._wrappedLife>0&&(this._wrappedParticles+=t),this._particleIndex=s%i,this._emitted.push([this._particleLife,e])}_uploadEmitted(t){this._particleIndex!==this._uploadIndex&&(t.bindBuffer(t.ARRAY_BUFFER,this._buffers[(this._drawIndex+1)%2]),this._particleIndex>=this._uploadIndex?t.bufferSubData(t.ARRAY_BUFFER,this._uploadIndex*4,this._particleData,this._uploadIndex,this._particleIndex-this._uploadIndex):(t.bufferSubData(t.ARRAY_BUFFER,this._uploadIndex*4,this._particleData,this._uploadIndex,this._particleData.length-this._uploadIndex),this._wrappedParticles&&t.bufferSubData(t.ARRAY_BUFFER,0,this._particleData,0,this._wrappedParticles*this._numInputFloats),this._wrappedLife=this._particleLife),t.bindBuffer(t.ARRAY_BUFFER,null)),this._uploadIndex=this._particleIndex%(this.maxParticles*this._numInputFloats)}update(t){var e;if(this._particleLife=(e=this.particle.life)!=null?e:this._particleLife,this._wrappedLife>0?this._wrappedLife-=t:(this._wrappedLife=0,this._wrappedParticles=0),!!this._emitted.length){for(let i=this._emitted.length-1;i>=0;i--){const s=this._emitted[i];s[0]-=t,s[0]<=0&&this._emitted.splice(i,1)}this._emitted.sort((i,s)=>i[0]-s[0])}}draw(t){if(this._initialized){if(this._clearRequested?(t.bindBuffer(t.ARRAY_BUFFER,this._buffers[(this._drawIndex+1)%2]),t.bufferSubData(t.ARRAY_BUFFER,0,this._particleData),t.bindBuffer(t.ARRAY_BUFFER,null),this._clearRequested=!1):this._uploadEmitted(t),t.bindVertexArray(this._currentVao),t.bindBufferBase(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer),this._wrappedLife&&this._emitted[0]&&this._emitted[0][1]>0){const e=this._emitted[0][1]/this._numInputFloats;Jn(`midpoint greater than 0, actual: ${e}`,()=>e>0),Jn(`midpoint is less than max, actual: ${e}`,()=>e<this.maxParticles),t.bindBufferRange(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer,this._emitted[0][1]*4,(this.maxParticles-e)*this._numInputFloats*4),t.beginTransformFeedback(t.POINTS),t.drawArrays(t.POINTS,e,this.maxParticles-e),t.endTransformFeedback(),t.bindBufferRange(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer,0,this._emitted[0][1]*4),t.beginTransformFeedback(t.POINTS),t.drawArrays(t.POINTS,0,e),t.endTransformFeedback()}else t.bindBufferRange(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer,0,this._particleData.length*4),t.beginTransformFeedback(t.POINTS),t.drawArrays(t.POINTS,0,this.maxParticles),t.endTransformFeedback();t.bindVertexArray(null),t.bindBufferBase(t.TRANSFORM_FEEDBACK_BUFFER,0,null),this._currentVao=this._vaos[this._drawIndex%2],this._currentBuffer=this._buffers[(this._drawIndex+1)%2],this._drawIndex=(this._drawIndex+1)%2}}}hs.GPU_MAX_PARTICLES=1e5;class $l extends kt{constructor(t){super({name:"GpuParticleEmitter",width:t.width,height:t.height}),this.particle={life:2e3,transform:Xt.Global,graphic:void 0,opacity:1,angularVelocity:0,focus:void 0,focusAccel:void 0,randomRotation:!1},this.graphics=new K,this.isEmitting=!1,this.emitRate=1,this.emitterType=Ee.Rectangle,this.radius=0,this.maxParticles=2e3,this._particlesToEmit=0,this.addComponent(this.graphics,!0),this.graphics.onPostDraw=this.draw.bind(this);const{particle:e,maxParticles:i,x:s,y:n,z:o,pos:a,isEmitting:h,emitRate:l,emitterType:c,radius:u,random:_}={...t};this.maxParticles=B(i!=null?i:this.maxParticles,0,hs.GPU_MAX_PARTICLES),this.pos=a!=null?a:b(s!=null?s:0,n!=null?n:0),this.z=o!=null?o:0,this.isEmitting=h!=null?h:this.isEmitting,this.emitRate=l!=null?l:this.emitRate,this.emitterType=c!=null?c:this.emitterType,this.radius=u!=null?u:this.radius,this.particle={...this.particle,...e},this.random=_!=null?_:new se,this.renderer=new hs(this,this.random,this.particle)}get pos(){return this.transform.pos}set pos(t){this.transform.pos=t}get z(){return this.transform.z}set z(t){this.transform.z=t}_initialize(t){super._initialize(t);const e=t.graphicsContext;this.renderer.initialize(e.__gl,e)}update(t,e){super.update(t,e),this.isEmitting&&(this._particlesToEmit+=this.emitRate*(e/1e3),this._particlesToEmit>1&&(this.emitParticles(Math.floor(this._particlesToEmit)),this._particlesToEmit=this._particlesToEmit-Math.floor(this._particlesToEmit))),this.renderer.update(e)}emitParticles(t){t<=0||this.renderer.emitParticles(t|0)}clearParticles(){this.renderer.clearParticles()}draw(t,e){t.draw("ex.particle",this.renderer,e)}}class Kn{constructor(t,e){this.id=H(),this._stopped=!1,this._sequenceBuilder=e,this._sequenceContext=new fi(t),this._actionQueue=this._sequenceContext.getQueue(),this._sequenceBuilder(this._sequenceContext)}update(t){this._actionQueue.update(t)}isComplete(){return this._stopped||this._actionQueue.isComplete()}stop(){this._stopped=!0}reset(){this._stopped=!1,this._actionQueue.reset()}clone(t){return new Kn(t,this._sequenceBuilder)}}class Zl{constructor(t){this.id=H(),this._actions=t}update(t){for(let e=0;e<this._actions.length;e++)this._actions[e].update(t)}isComplete(t){return this._actions.every(e=>e.isComplete(t))}reset(){this._actions.forEach(t=>t.reset())}stop(){this._actions.forEach(t=>t.stop())}}function jl(r){return!!r._initialize}function Ql(r){return!!r.onAdd}function Jl(r){return!!r.onRemove}function Kl(r){return!!r.onInitialize}function tc(r){return!!r._preupdate}function ec(r){return!!r.onPreUpdate}function ic(r){return!!r.onPostUpdate}function sc(r){return!!r.onPostUpdate}function nc(r){return!!r.onAdd}function rc(r){return!!r.onRemove}function oc(r){return!!r.onPreDraw}function ac(r){return!!r.onPostDraw}class xa{constructor(t,e){this.soundManager=e}stop(t){if(!t)return;const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)e[i].stop()}setVolume(t,e){const i=this.soundManager.getSoundsForChannel(t);for(const s of i)this.soundManager._isMuted(s)||this.soundManager.setVolume(t,e)}play(t,e){e!=null||(e=this.soundManager.defaultVolume);const i=[],s=new Set,n=this.soundManager.getSoundsForChannel(t);for(const o of n){if(s.has(o)||this.soundManager._isMuted(o))continue;const a=this.soundManager._getEffectiveVolume(o);i.push(o.play(a*e)),s.add(o)}return Promise.all(i)}mute(t){const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)this.soundManager._muted.add(e[i]),e[i].pause()}unmute(t){const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)this.soundManager._muted.has(e[i])&&(e[i].play(),this.soundManager._muted.delete(e[i]))}toggle(t){const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)this.soundManager._isMuted(e[i])?(e[i].play(),this.soundManager._muted.delete(e[i])):(this.soundManager._muted.add(e[i]),e[i].pause())}}class hc{constructor(t){this._channelToConfig=new Map,this._nameToConfig=new Map,this._mix=new Map,this._muted=new Set,this._all=new Set,this._defaultVolume=1;var e;if(this._defaultVolume=(e=t.volume)!=null?e:1,this.channel=new xa(t,this),t.sounds)for(const[i,s]of Object.entries(t.sounds))this.track(i,s)}set defaultVolume(t){this._defaultVolume=B(t,0,1)}get defaultVolume(){return this._defaultVolume}getSounds(){return Array.from(this._all)}getSoundsForChannel(t){const e=this._channelToConfig.get(t);return e?e.sounds:[]}_isMuted(t){return this._muted.has(t)}_getEffectiveVolume(t){var e;if(this._isMuted(t))return 0;let i=this._defaultVolume;return this._mix.has(t)&&(i*=(e=this._mix.get(t))!=null?e:this._defaultVolume),i}play(t,e=this._defaultVolume){const i=this._nameToConfig.get(t);if(!i)return Promise.resolve();const{sound:s}=i;if(this._isMuted(s))return Promise.resolve();const n=e*this._getEffectiveVolume(s);return s.play(n)}getSound(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;return i}setVolume(t,e=this._defaultVolume){const i=this._nameToConfig.get(t);if(!i)return;const{sound:s}=i;this._setMix(s,e)}getVolume(t){var e;const i=this.getSound(t);return i&&(e=this._mix.get(i))!=null?e:0}_setMix(t,e){this._mix.set(t,e),t.volume=e}track(t,e){let i,s,n;e instanceof Un?(i=e,s=this._defaultVolume,n=[]):{sound:i,volume:s,channels:n}=e,this._nameToConfig.set(t,{sound:i,volume:s,channels:n}),this._mix.set(i,s!=null?s:this._defaultVolume),this._all.add(i),n&&this.addChannel(t,n)}untrack(t){this._nameToConfig.delete(t);const e=this.getSound(t);e&&(this._mix.delete(e),this._all.delete(e))}stop(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;i.stop();return}this._all.forEach(e=>e.stop())}mute(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;this._muted.add(i),i.pause();return}this._muted=new Set(this._all),this._muted.forEach(e=>e.pause())}unmute(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;i.play(),this._muted.delete(i);return}this._muted.forEach(e=>e.play()),this._muted.clear()}toggle(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;this._isMuted(i)?this.unmute(t):this.mute(t);return}this._muted.size>0?(this._muted.forEach(e=>e.play()),this._muted.clear()):(this._muted=new Set(this._all),this._muted.forEach(e=>e.pause()))}addChannel(t,e){const i=this.getSound(t);if(!i)return;const s=this._mix.get(i);this._mix.set(i,s!=null?s:this._defaultVolume),this._all.add(i);for(const n of e){let o=this._channelToConfig.get(n);o||(o={sounds:[i]}),o.sounds.indexOf(i)===-1&&o.sounds.push(i),this._channelToConfig.set(n,o)}}removeChannel(t,e){const i=this.getSound(t);if(i)for(const s of e){const n=this._channelToConfig.get(s);if(!n)return;const o=n.sounds.indexOf(i);o>=-1&&n.sounds.splice(o,1),this._channelToConfig.set(s,n)}}}class lc{constructor(t,e=!1){this.path=t,this.width=0,this.height=0,this._images=[],this.data=[],this._sprites=[],this._resource=new li(t,"arraybuffer",e)}get bustCache(){return this._resource.bustCache}set bustCache(t){this._resource.bustCache=t}async load(){const t=await this._resource.load();this._stream=new ba(t),this._gif=new ya(this._stream);const e=this._gif.images.map(i=>new qt(i.src,!1));return await Promise.all(e.map(i=>i.load())),this.data=this._images=e,this._sprites=this._images.map(i=>i.toSprite()),this.data}isLoaded(){return!!this.data}toSprite(t=0){var e;return(e=this._sprites[t])!=null?e:null}toSpriteSheet(){const t=this._sprites;return t.length?new ye({sprites:t}):null}toAnimation(t){var e;const i=(e=this._gif)==null?void 0:e.images;if(i!=null&&i.length){const s=i.map((n,o)=>{var a;return{graphic:this._sprites[o],duration:((a=this._gif)==null?void 0:a.frames[o].delayMs)||void 0}});return this._animation=new Ui({frames:s,frameDuration:t}),this._animation}return null}get readCheckBytes(){var t,e;return(e=(t=this._gif)==null?void 0:t.checkBytes)!=null?e:[]}}const ls=r=>r.reduce(function(t,e){return t*2+e},0),tr=r=>{const t=[];for(let e=7;e>=0;e--)t.push(!!(r&1<<e));return t};class ba{constructor(t){if(this.len=0,this.position=0,this.readByte=()=>{if(this.position>=this.data.byteLength)throw new Error("Attempted to read past end of stream.");return this.data[this.position++]},this.readBytes=e=>{const i=[];for(let s=0;s<e;s++)i.push(this.readByte());return i},this.read=e=>{let i="";for(let s=0;s<e;s++)i+=String.fromCharCode(this.readByte());return i},this.readUnsigned=()=>{const e=this.readBytes(2);return(e[1]<<8)+e[0]},this.data=new Uint8Array(t),this.len=this.data.byteLength,this.len===0)throw new Error("No data loaded from file")}}const cc=function(r,t){let e=0;const i=function(_){let f=0;for(let m=0;m<_;m++)t.charCodeAt(e>>3)&1<<(e&7)&&(f|=1<<m),e++;return f},s=[],n=1<<r,o=n+1;let a=r+1,h=[];const l=function(){h=[],a=r+1;for(let _=0;_<n;_++)h[_]=[_];h[n]=[],h[o]=null};let c=0,u=0;for(;;){if(u=c,c=i(a),c===n){l();continue}if(c===o)break;if(c<h.length)u!==n&&h.push(h[u].concat(h[c][0]));else{if(c!==h.length)throw new Error("Invalid LZW code.");h.push(h[u].concat(h[u][0]))}s.push.apply(s,h[c]),h.length===1<<a&&a<12&&a++}return s};class ya{constructor(t){this._handler={},this.frames=[],this.images=[],this.globalColorTableBytes=[],this.checkBytes=[],this.parseColorTableBytes=e=>{const i=[];for(let s=0;s<e;s++){const n=this._st.readBytes(3);i.push(n)}return i},this.readSubBlocks=()=>{let e,i;i="";do e=this._st.readByte(),i+=this._st.read(e);while(e!==0);return i},this.parseHeader=()=>{const e={sig:"",ver:"",width:0,height:0,colorResolution:0,globalColorTableSize:0,gctFlag:!1,sortedFlag:!1,globalColorTable:[],backgroundColorIndex:0,pixelAspectRatio:0};if(e.sig=this._st.read(3),e.ver=this._st.read(3),e.sig!=="GIF")throw new Error("Not a GIF file.");e.width=this._st.readUnsigned(),e.height=this._st.readUnsigned(),this._currentFrameCanvas.width=e.width,this._currentFrameCanvas.height=e.height;const i=tr(this._st.readByte());e.gctFlag=i.shift(),e.colorResolution=ls(i.splice(0,3)),e.sortedFlag=i.shift(),e.globalColorTableSize=ls(i.splice(0,3)),e.backgroundColorIndex=this._st.readByte(),e.pixelAspectRatio=this._st.readByte(),e.gctFlag&&(this.globalColorTableBytes=this.parseColorTableBytes(1<<e.globalColorTableSize+1)),this._handler.hdr&&this._handler.hdr(e)&&this.checkBytes.push(this._handler.hdr)},this.parseExt=e=>{const i=h=>{this.checkBytes.push(this._st.readByte());const l=tr(this._st.readByte());return h.reserved=l.splice(0,3),h.disposalMethod=ls(l.splice(0,3)),h.userInputFlag=l.shift(),h.transparentColorFlag=l.shift(),h.delayTime=this._st.readUnsigned(),h.transparentColorIndex=this._st.readByte(),h.terminator=this._st.readByte(),this._handler.gce&&this._handler.gce(h)&&this.checkBytes.push(this._handler.gce),h},s=h=>{h.comment=this.readSubBlocks(),this._handler.com&&this._handler.com(h)&&this.checkBytes.push(this._handler.com)},n=h=>{this.checkBytes.push(this._st.readByte()),h.ptHeader=this._st.readBytes(12),h.ptData=this.readSubBlocks(),this._handler.pte&&this._handler.pte(h)&&this.checkBytes.push(this._handler.pte)},o=h=>{const l=u=>{this.checkBytes.push(this._st.readByte()),u.unknown=this._st.readByte(),u.iterations=this._st.readUnsigned(),u.terminator=this._st.readByte(),this._handler.app&&this._handler.app.NETSCAPE&&this._handler.app.NETSCAPE(u)&&this.checkBytes.push(this._handler.app)},c=u=>{u.appData=this.readSubBlocks(),this._handler.app&&this._handler.app[u.identifier]&&this._handler.app[u.identifier](u)&&this.checkBytes.push(this._handler.app[u.identifier])};switch(this.checkBytes.push(this._st.readByte()),h.identifier=this._st.read(8),h.authCode=this._st.read(3),h.identifier){case"NETSCAPE":l(h);break;default:c(h);break}},a=h=>{h.data=this.readSubBlocks(),this._handler.unknown&&this._handler.unknown(h)&&this.checkBytes.push(this._handler.unknown)};switch(e.label=this._st.readByte(),e.label){case 249:e.extType="gce",this._gce=i(e);break;case 254:e.extType="com",s(e);break;case 1:e.extType="pte",n(e);break;case 255:e.extType="app",o(e);break;default:e.extType="unknown",a(e);break}},this.parseImg=e=>{var i;const s=(a,h)=>{const l=new Array(a.length),c=a.length/h,u=(p,x)=>{const v=a.slice(x*h,(x+1)*h);l.splice.apply(l,[p*h,h].concat(v))},_=[0,4,2,1],f=[8,8,4,2];let m=0;for(let p=0;p<4;p++)for(let x=_[p];x<c;x+=f[p])u(x,m),m++;return l};e.leftPos=this._st.readUnsigned(),e.topPos=this._st.readUnsigned(),e.width=this._st.readUnsigned(),e.height=this._st.readUnsigned();const n=tr(this._st.readByte());e.lctFlag=n.shift(),e.interlaced=n.shift(),e.sorted=n.shift(),e.reserved=n.splice(0,2),e.lctSize=ls(n.splice(0,3)),e.lctFlag&&(e.lctBytes=this.parseColorTableBytes(1<<e.lctSize+1)),e.lzwMinCodeSize=this._st.readByte();const o=this.readSubBlocks();e.pixels=cc(e.lzwMinCodeSize,o),e.interlaced&&(e.pixels=s(e.pixels,e.width)),(i=this._gce)!=null&&i.delayTime&&(e.delayMs=this._gce.delayTime*10),this.frames.push(e),this.arrayToImage(e,e.lctFlag?e.lctBytes:this.globalColorTableBytes),this._handler.img&&this._handler.img(e)&&this.checkBytes.push(this._handler)},this.parseBlocks=()=>{const e={sentinel:this._st.readByte(),type:""};switch(String.fromCharCode(e.sentinel)){case"!":e.type="ext",this.parseExt(e);break;case",":e.type="img",this.parseImg(e);break;case";":e.type="eof",this._handler.eof&&this._handler.eof(e)&&this.checkBytes.push(this._handler.eof);break;default:throw new Error("Unknown block: 0x"+e.sentinel.toString(16))}e.type!=="eof"&&this.parseBlocks()},this.arrayToImage=(e,i)=>{var s,n,o,a;const h=document.createElement("canvas");h.width=e.width,h.height=e.height;const l=h.getContext("2d"),c=l.getImageData(0,0,h.width,h.height);let u=-1;(s=this._gce)!=null&&s.transparentColorFlag&&(u=this._gce.transparentColorIndex);for(let f=0;f<e.pixels.length;f++){const m=e.pixels[f],p=i[m];m===u?c.data.set([0,0,0,0],f*4):c.data.set([...p,255],f*4)}if(l.putImageData(c,0,0),((n=this._gce)==null?void 0:n.disposalMethod)===1&&this.images.length)this._currentFrameContext.drawImage(this.images[this.images.length-1],0,0);else if(((o=this._gce)==null?void 0:o.disposalMethod)===2&&((a=this._hdr)!=null&&a.gctFlag)){const f=i[this._hdr.backgroundColorIndex];this._currentFrameContext.fillStyle=`rgb(${f[0]}, ${f[1]}, ${f[2]})`,this._currentFrameContext.fillRect(0,0,this._hdr.width,this._hdr.height)}else this._currentFrameContext.clearRect(0,0,this._currentFrameCanvas.width,this._currentFrameCanvas.height);this._currentFrameContext.drawImage(h,e.leftPos,e.topPos,e.width,e.height);const _=new Image;_.src=this._currentFrameCanvas.toDataURL(),this.images.push(_)},this._st=t,this._handler={},this._currentFrameCanvas=document.createElement("canvas"),this._currentFrameContext=this._currentFrameCanvas.getContext("2d"),this.parseHeader(),this.parseBlocks()}}class dc{constructor(t,e,{bustCache:i,...s}={}){this.path=t,this.family=e,this._isLoaded=!1,this._resource=new li(t,"blob",i),this._options=s}async load(){if(this.isLoaded())return this.data;try{const t=await this._resource.load(),e=URL.createObjectURL(t);this.data||(this.data=new FontFace(this.family,`url(${e})`),document.fonts.add(this.data)),await this.data.load(),this._isLoaded=!0}catch(t){throw`Error loading FontSource from path '${this.path}' with error [${t.message}]`}return this.data}isLoaded(){return this._isLoaded}toFont(t){return new Se({family:this.family,...this._options,...t})}}const Ca=ma(),uc=/^\s*(?:function)?\*/;function Sa(r){return typeof r!="function"?!1:uc.test(Function.prototype.toString.call(r))?!0:Object.getPrototypeOf?Object.getPrototypeOf(r)===Object.getPrototypeOf(new Function("return function * () {}")()):!1}function Ta(...r){var t;const e=R.getInstance();let i,s,n,o;Sa(r[0])&&(s=globalThis,i=r[0],n=r[1]),Sa(r[1])&&(s=r[0],i=r[1],n=r[2]),r[1]instanceof as&&(s=r[0],o=r[1],i=r[2],n=r[3]),r[0]instanceof as&&(s=globalThis,o=r[0],i=r[1],n=r[2]);const a=va(Ca),h=n==null?void 0:n.timing,l=a?!1:(t=n==null?void 0:n.autostart)!=null?t:!0;let c;try{c=o!=null?o:as.useEngine()}catch(y){throw Error(`Cannot run coroutine without engine parameter outside of an excalibur lifecycle method.
|
|
930
930
|
Pass an engine parameter to ex.coroutine(engine, function * {...})`)}let u=!1,_=!1,f=!1;const m=i.bind(s),p=m();let x;const v=new Promise((y,S)=>{x=A=>{try{if(f){_=!0,y();return}const{done:I,value:C}=Ca.scope(!0,()=>p.next(A));if(I||f){_=!0,y();return}C instanceof Promise?C.then(()=>{c.clock.schedule(x,0,h)}):C===void 0||C===void 0?c.clock.schedule(x,0,h):c.clock.schedule(x,C||0,h)}catch(I){S(I);return}},l&&(u=!0,x(c.clock.elapsed()))}),g={isRunning:()=>u&&!f&&!_,isComplete:()=>_,cancel:()=>{f=!0},start:()=>(u?e.warn(`.start() was called on a coroutine that was already started, this is probably a bug:
|
|
931
|
-
`,Function.prototype.toString.call(m)):(u=!0,x(c.clock.elapsed())),g),generator:p,done:v,then:v.then.bind(v),[Symbol.iterator]:()=>p};return g}class cs extends At{constructor(t){var e,i,s,n,o;super(),this._logger=R.getInstance(),this.transform=new P,this.graphics=new K,this._completeFuture=new wt,this.started=!1,this._currentDistance=0,this._currentProgress=0,this.done=this._completeFuture.promise,this._useLegacyEasing=!1,this.name=`Transition#${this.id}`,this.duration=t.duration,Te(t.easing)?(this.legacyEasing=(e=t.easing)!=null?e:Rt.Linear,this._useLegacyEasing=!0):this.easing=(i=t.easing)!=null?i:Ai,this.direction=(s=t.direction)!=null?s:"out",this.hideLoader=(n=t.hideLoader)!=null?n:!1,this.blockInput=(o=t.blockInput)!=null?o:!1,this.transform.coordPlane=rt.Screen,this.transform.pos=w.Zero,this.transform.z=1/0,this.graphics.anchor=w.Zero,this.addComponent(this.transform),this.addComponent(this.graphics),this.direction==="out"?this._currentProgress=0:this._currentProgress=1}get progress(){return this._currentProgress}get distance(){return this._currentDistance}get complete(){return this.direction==="out"?this.progress>=1:this.progress<=0}updateTransition(t,e){this.complete||(this._currentDistance+=B(e/this.duration,0,1),this._currentDistance>=1&&(this._currentDistance=1),this.direction==="out"?this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,0,1,1),0,1):this._currentProgress=B(ot(0,1,this.easing(this._currentDistance)),0,1):this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,1,0,1),0,1):this._currentProgress=B(ot(1,0,this.easing(this._currentDistance)),0,1))}async onPreviousSceneDeactivate(t){}onStart(t){}onUpdate(t){}onEnd(t){}onReset(){}reset(){this.started=!1,this._completeFuture=new wt,this.done=this._completeFuture.promise,this._currentDistance=0,this.direction==="out"?this._currentProgress=0:this._currentProgress=1,this.onReset()}_addToTargetScene(t,e){const i=e;if(this.started&&this._logger.warn(`Attempted to add a transition ${this.name} that is already playing.`),i.world.entityManager.getById(this.id))return this._co;this._engine=t,i.add(this);const s=this;return this._co=Ta(t,function*(){for(;!s.complete;){const n=yield;s.updateTransition(s._engine,n),s._execute()}},{autostart:!1}),this._co}async _play(){this.started&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that is already playing, reset transition.`)),(!this._engine||!this._co)&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that hasn't been added`)),this._co&&await this._co.start()}_execute(){this.isInitialized&&(this.started||(this.started=!0,this.onStart(this.progress)),this.onUpdate(this.progress),this.complete&&!this._completeFuture.isCompleted&&(this.onEnd(this.progress),this._completeFuture.resolve()))}}class _c extends cs{constructor(t){var e,i;super({...t,duration:(e=t.duration)!=null?e:2e3}),this.name=`FadeInOut#${this.id}`,this.color=(i=t.color)!=null?i:T.Black}onInitialize(t){this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=new ui({width:t.screen.resolution.width,height:t.screen.resolution.height,color:this.color}),this.graphics.add(this.screenCover),this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=t}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class fc extends cs{constructor(t){super({direction:"in",...t}),this.name=`CrossFade#${this.id}`}async onPreviousSceneDeactivate(t){this.image=await t.engine.screenshot(!0),await this.image.decode()}onInitialize(t){this.engine=t,this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=qt.fromHtmlImageElement(this.image).toSprite(),this.graphics.add(this.screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio),this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class gc extends cs{constructor(t){var e;super({direction:"in",...t}),this._easing=Rt.Linear,this._start=w.Zero,this._end=w.Zero,this.name=`Slide#${this.id}`,this.slideDirection=t.slideDirection,this.transform.coordPlane=rt.Screen,this.graphics.forceOnScreen=!0,this._easing=(e=t.easingFunction)!=null?e:this._easing}async onPreviousSceneDeactivate(t){this._image=await t.engine.screenshot(!0),await this._image.decode(),this._screenCover=qt.fromHtmlImageElement(this._image).toSprite()}onInitialize(t){this._engine=t;let e=t.screen.unsafeArea;switch(e.hasZeroDimensions()&&(e=t.screen.contentArea),this.slideDirection){case"up":{this._directionOffset=b(0,-e.height);break}case"down":{this._directionOffset=b(0,e.height);break}case"left":{this._directionOffset=b(-e.width,0);break}case"right":{this._directionOffset=b(e.width,0);break}}this._camera=this._engine.currentScene.camera,this._destinationCameraPosition=this._camera.pos.clone(),this._camera.pos=this._camera.pos.add(this._directionOffset),this.transform.pos=this.transform.pos.add(this._directionOffset),this._startCameraPosition=this._camera.pos.clone(),this._start=e.topLeft,this._end=this._start.add(this._directionOffset),this.transform.pos=this._start,this.graphics.use(this._screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio)}onStart(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}onUpdate(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}}const pc=Object.freeze(Object.defineProperty({__proto__:null,ConsoleAppender:Cs,DrawUtil:zh,EasingFunctions:Rt,LogLevel:Le,Logger:R,Observable:gt,ScreenAppender:mr,addItemToArray:Ch,contains:xr,delay:Fi,fail:br,getMinIndex:wr,getPosition:oi,isLegacyEasing:Te,isObject:Di,mergeDeep:Bi,omit:yr,removeItemFromArray:He},Symbol.toStringTag,{value:"Module"})),Aa=5,ti={},mc=()=>{for(const r in ti)ti[r]=0},ds=(r,t)=>{const e=De.isEnabled("suppress-obsolete-message");ti[r]<Aa&&!e&&(R.getInstance().warn(r),console.trace&&t.showStackTrace&&console.trace()),ti[r]++};function vc(r){return r={message:"This feature will be removed in future versions of Excalibur.",alternateMethod:null,showStackTrace:!1,...r},function(t,e,i){if(i&&!(typeof i.value=="function"||typeof i.get=="function"||typeof i.set=="function"))throw new SyntaxError("Only classes/functions/getters/setters can be marked as obsolete");const n=`${`${t.name||""}${t.name&&e?".":""}${e||""}`} is marked obsolete: ${r.message}`+(r.alternateMethod?` Use ${r.alternateMethod} instead`:"");ti[n]||(ti[n]=0);const o=i?{...i}:t;if(!i){class a extends o{constructor(...l){ds(n,r),super(...l)}}return a}return i&&i.value?(o.value=function(){return ds(n,r),i.value.apply(this,arguments)},o):(i&&i.get&&(o.get=function(){return ds(n,r),i.get.apply(this,arguments)}),i&&i.set&&(o.set=function(){return ds(n,r),i.set.apply(this,arguments)}),o)}}class wc{constructor(){this._queue=[]}get length(){return this._queue.length}enqueue(){const t=new wt;return this._queue.push(t),t.promise}dequeue(t){this._queue.shift().resolve(t)}}class xc{constructor(t){this._count=t,this._waitQueue=new wc}get count(){return this._count}get waiting(){return this._waitQueue.length}async enter(){return this._count!==0?(this._count--,Promise.resolve()):this._waitQueue.enqueue()}exit(t=1){if(t!==0){for(;t!==0&&this._waitQueue.length!==0;)this._waitQueue.dequeue(null),t--;this._count+=t}}}const er="0.32.0-alpha.1587+0f92426";Fe(),d.ActionCompleteEvent=js,d.ActionContext=fi,d.ActionQueue=eo,d.ActionSequence=Kn,d.ActionStartEvent=Zs,d.ActionsComponent=Qe,d.ActionsSystem=Vn,d.ActivateEvent=Gs,d.Actor=kt,d.ActorEvents=Al,d.AddEvent=Qs,d.AddedComponent=Sh,d.AffineMatrix=Z,d.Animation=Ui,d.AnimationDirection=Br,d.AnimationEvents=Dh,d.AnimationStrategy=kr,d.ArcadeSolver=Fn,d.AudioContextFactory=pi,d.Axes=ea,d.Axis=Yo,d.BaseAlign=ln,d.BezierCurve=si,d.Blink=yo,d.BodyComponent=N,d.BoundingBox=F,d.BrowserComponent=$n,d.BrowserEvents=da,d.Buttons=qn,d.Camera=Ko,d.CameraEvents=Ul,d.Canvas=Xi,d.ChannelCollection=xa,d.Circle=qi,d.CircleCollider=dt,d.Clock=Zn,d.ClosestLineJumpTable=Vt,d.Collider=ai,d.ColliderComponent=tt,d.CollisionContact=xe,d.CollisionEndEvent=ri,d.CollisionGroup=me,d.CollisionGroupManager=Pi,d.CollisionJumpTable=zt,d.CollisionPostSolveEvent=Mi,d.CollisionPreSolveEvent=Ri,d.CollisionStartEvent=ni,d.CollisionSystem=Qi,d.CollisionType=M,d.Color=T,d.ColorBlindFlags=la,d.ColorBlindnessMode=$e,d.ColorBlindnessPostProcessor=Qr,d.Component=Dt,d.CompositeCollider=at,d.ConsoleAppender=Cs,d.ContactConstraintPoint=Mo,d.ContactEndEvent=Ii,d.ContactSolveBias=ae,d.ContactStartEvent=Ei,d.CoordPlane=rt,d.CrossFade=fc,d.CurveBy=Eo,d.CurveTo=Po,d.DeactivateEvent=Vs,d.Debug=Tt,d.DebugConfig=ca,d.DebugGraphicsComponent=Wi,d.DebugSystem=Gn,d.DebugText=fn,d.DefaultAntialiasOptions=Or,d.DefaultGarbageCollectionOptions=Qn,d.DefaultLoader=mi,d.DefaultPixelArtOptions=Hr,d.DegreeOfFreedom=le,d.Delay=So,d.Detector=Oo,d.Die=To,d.Direction=dn,d.Director=pa,d.DirectorEvents=ga,d.DisplayMode=gi,d.DynamicTree=en,d.DynamicTreeCollisionProcessor=ki,d.EX_VERSION=er,d.EaseBy=bo,d.EaseTo=xo,d.EasingFunctions=Rt,d.Edge=ws,d.EdgeCollider=St,d.ElasticToActorStrategy=jo,d.EmitterType=Ee,d.Engine=as,d.EngineEvents=ql,d.EnterTriggerEvent=Ys,d.EnterViewPortEvent=Xs,d.Entity=At,d.EntityEvents=Eh,d.EntityManager=Sr,d.EventEmitter=X,d.EventTypes=Ts,d.Events=yh,d.ExResponse=Ln,d.ExcaliburGraphicsContext2DCanvas=Yi,d.ExcaliburGraphicsContextWebGL=$t,d.ExitTriggerEvent=$s,d.ExitViewPortEvent=qs,d.Fade=Co,d.FadeInOut=_c,d.Flags=De,d.Flash=Ao,d.Follow=Pn,d.Font=Se,d.FontCache=Vi,d.FontSource=dc,d.FontStyle=cn,d.FontUnit=an,d.FpsSampler=ua,d.FrameStats=yi,d.Future=wt,d.GameEvent=k,d.GameStartEvent=Is,d.GameStopEvent=Rs,d.Gamepad=ss,d.GamepadAxisEvent=Hs,d.GamepadButtonEvent=Os,d.GamepadConnectEvent=zs,d.GamepadDisconnectEvent=Us,d.Gamepads=is,d.GarbageCollector=wa,d.Gif=lc,d.GifParser=ya,d.GlobalCoordinates=ke,d.GpuParticleEmitter=$l,d.GpuParticleRenderer=hs,d.Graph=vs,d.Graphic=st,d.GraphicsComponent=K,d.GraphicsGroup=We,d.GraphicsSystem=pn,d.HashColliderProxy=Ro,d.HashGridCell=Zt,d.HashGridProxy=In,d.HiddenEvent=Ws,d.HorizontalFirst=nn,d.ImageFiltering=mt,d.ImageSource=qt,d.ImageSourceAttributeConstants=U,d.ImageWrapping=_t,d.InitializeEvent=Oe,d.InputHost=Yn,d.InputMapper=ia,d.IsometricEntityComponent=vi,d.IsometricEntitySystem=Wn,d.IsometricMap=zl,d.IsometricTile=qo,d.KeyEvent=wi,d.Keyboard=aa,d.Keys=oa,d.KillEvent=As,d.Label=Xl,d.LimitCameraBoundsStrategy=Jo,d.Line=gn,d.LineSegment=Q,d.Loader=Ki,d.LoaderEvents=Fl,d.LockCameraToActorAxisStrategy=Zo,d.LockCameraToActorStrategy=$o,d.LogLevel=Le,d.Logger=R,d.Material=Kr,d.Matrix=Ct,d.MatrixLocations=cr,d.MediaEvent=zn,d.Meet=Zi,d.MotionComponent=O,d.MotionSystem=ji,d.MoveBy=Tn,d.MoveByWithOptions=ro,d.MoveTo=An,d.MoveToWithOptions=ao,d.NativePointerButton=Pe,d.NativeSoundEvent=Ae,d.NativeSoundProcessedEvent=Lo,d.NineSlice=wn,d.NineSliceStretch=Ur,d.Node=Ti,d.None=rn,d.Observable=gt,d.OffscreenSystem=mn,d.Pair=pt,d.ParallaxComponent=Gi,d.ParallelActions=Zl,d.Particle=$i,d.ParticleEmitter=Yl,d.ParticleRenderer=Zr,d.ParticleTransform=Xt,d.PhysicsStats=rs,d.PhysicsWorld=Fo,d.PointerAbstraction=Xn,d.PointerButton=ce,d.PointerComponent=he,d.PointerEvent=xi,d.PointerEventReceiver=ns,d.PointerScope=Be,d.PointerSystem=es,d.PointerType=de,d.Polygon=vn,d.PolygonCollider=lt,d.Pool=zi,d.PositionNode=_r,d.PostCollisionEvent=we,d.PostDebugDrawEvent=Bs,d.PostDrawEvent=Ue,d.PostFrameEvent=Ls,d.PostKillEvent=Es,d.PostTransformDrawEvent=Fs,d.PostUpdateEvent=oe,d.PreCollisionEvent=ve,d.PreDebugDrawEvent=Ds,d.PreDrawEvent=ze,d.PreFrameEvent=ks,d.PreKillEvent=Ps,d.PreLoadEvent=Wl,d.PreTransformDrawEvent=Ms,d.PreUpdateEvent=re,d.Projection=ei,d.QuadIndexBuffer=Ze,d.QuadTree=Je,d.Query=Lt,d.QueryManager=Tr,d.RadiusAroundActorStrategy=Qo,d.Random=se,d.Raster=Ge,d.Ray=ge,d.RealisticSolver=Dn,d.Rectangle=ui,d.RemoveEvent=Js,d.RemovedComponent=Ah,d.RentalPool=qe,d.Repeat=io,d.RepeatForever=so,d.Resolution=Bn,d.Resource=li,d.ResourceEvents=Hh,d.RotateBy=uo,d.RotateByWithOptions=co,d.RotateTo=lo,d.RotateToWithOptions=ho,d.RotationType=j,d.ScaleBy=vo,d.ScaleByWithOptions=mo,d.ScaleTo=go,d.ScaleToWithOptions=fo,d.Scene=Mt,d.SceneEvents=Gl,d.Screen=kn,d.ScreenAppender=mr,d.ScreenElement=Hn,d.ScreenEvents=Pl,d.ScreenShader=jr,d.ScrollPreventionMode=Ke,d.Semaphore=xc,d.SeparatingAxis=Ne,d.SeparationInfo=Mr,d.Shader=Bt,d.Shape=ut,d.Slide=gc,d.SolverStrategy=Li,d.Sound=Un,d.SoundEvents=Rl,d.SoundManager=hc,d.SparseHashGrid=Rn,d.SparseHashGridCollisionProcessor=Mn,d.SpatialPartitionStrategy=hi,d.Sprite=Ut,d.SpriteFont=Oi,d.SpriteSheet=ye,d.StandardClock=jn,d.StateMachine=Ji,d.StrategyContainer=Xo,d.Stream=ba,d.System=Et,d.SystemManager=Pr,d.SystemPriority=Gt,d.SystemType=Pt,d.TagQuery=Ks,d.TestClock=_a,d.Text=_i,d.TextAlign=hn,d.TextureLoader=Xe,d.Tile=Vo,d.TileMap=Go,d.TileMapEvents=Ll,d.TiledAnimation=xn,d.TiledSprite=di,d.Timer=ts,d.Toaster=fa,d.Transform=Kt,d.TransformComponent=P,d.Transition=cs,d.TreeNode=tn,d.Trigger=ta,d.TriggerEvents=Ol,d.TwoPI=it,d.UniformBuffer=Nr,d.Util=pc,d.Vector=w,d.VectorView=ps,d.VertexBuffer=Ht,d.VertexLayout=Yt,d.VerticalFirst=sn,d.VisibleEvent=Ns,d.WebAudio=Bo,d.WebAudioInstance=ko,d.WheelDeltaMode=bi,d.WheelEvent=ha,d.World=Er,d.approximatelyEqual=ar,d.assert=Jn,d.canonicalizeAngle=Jt,d.clamp=B,d.coroutine=Ta,d.createId=fe,d.easeInBack=fh,d.easeInBounce=gr,d.easeInCirc=dh,d.easeInCubic=th,d.easeInElastic=mh,d.easeInExpo=hh,d.easeInOutBack=ph,d.easeInOutBounce=xh,d.easeInOutCirc=_h,d.easeInOutCubic=bs,d.easeInOutElastic=wh,d.easeInOutExpo=ch,d.easeInOutQuad=Ka,d.easeInOutQuart=nh,d.easeInOutQuint=ah,d.easeInOutSine=ja,d.easeInQuad=Qa,d.easeInQuart=ih,d.easeInQuint=rh,d.easeInSine=$a,d.easeOutBack=gh,d.easeOutBounce=ys,d.easeOutCirc=uh,d.easeOutCubic=eh,d.easeOutElastic=vh,d.easeOutExpo=lh,d.easeOutQuad=Ja,d.easeOutQuart=sh,d.easeOutQuint=oh,d.easeOutSine=Za,d.frac=Na,d.getDefaultPhysicsConfig=te,d.glTypeToUniformTypeName=Xr,d.hasGraphicsTick=Sn,d.hasOnAdd=nc,d.hasOnInitialize=Kl,d.hasOnPostUpdate=sc,d.hasOnPreUpdate=ec,d.hasOnRemove=rc,d.hasPostDraw=ac,d.hasPreDraw=oc,d.has_add=Ql,d.has_initialize=jl,d.has_postupdate=ic,d.has_preupdate=tc,d.has_remove=Jl,d.inverseLerp=dr,d.inverseLerpVector=ur,d.isActor=Tl,d.isAddedComponent=Th,d.isComponentCtor=vr,d.isLegacyEasing=Te,d.isLoaderConstructor=On,d.isMoveByOptions=no,d.isMoveToOptions=oo,d.isRemovedComponent=Ph,d.isRotateByOptions=Sl,d.isRotateToOptions=Cl,d.isScaleByOptions=po,d.isScaleToOptions=_o,d.isSceneConstructor=jt,d.isScreenElement=Ho,d.isSystemConstructor=Ar,d.lerp=ot,d.lerpAngle=ms,d.lerpVector=ii,d.linear=Ai,d.maxMessages=Aa,d.nextActionId=H,d.obsolete=vc,d.parseImageFiltering=Ve,d.parseImageWrapping=Ot,d.pixelSnapEpsilon=D,d.randomInRange=Nt,d.randomIntInRange=Va,d.range=Ga,d.remap=Wt,d.remapVector=qa,d.resetObsoleteCounter=mc,d.sign=V,d.smootherstep=Ya,d.smoothstep=Xa,d.toDegrees=hr,d.toRadians=Wa,d.vec=b,d.webgl=Yh,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
931
|
+
`,Function.prototype.toString.call(m)):(u=!0,x(c.clock.elapsed())),g),generator:p,done:v,then:v.then.bind(v),[Symbol.iterator]:()=>p};return g}class cs extends At{constructor(t){var e,i,s,n,o;super(),this._logger=R.getInstance(),this.transform=new P,this.graphics=new K,this._completeFuture=new wt,this.started=!1,this._currentDistance=0,this._currentProgress=0,this.done=this._completeFuture.promise,this._useLegacyEasing=!1,this.name=`Transition#${this.id}`,this.duration=t.duration,Te(t.easing)?(this.legacyEasing=(e=t.easing)!=null?e:Rt.Linear,this._useLegacyEasing=!0):this.easing=(i=t.easing)!=null?i:Ai,this.direction=(s=t.direction)!=null?s:"out",this.hideLoader=(n=t.hideLoader)!=null?n:!1,this.blockInput=(o=t.blockInput)!=null?o:!1,this.transform.coordPlane=rt.Screen,this.transform.pos=w.Zero,this.transform.z=1/0,this.graphics.anchor=w.Zero,this.addComponent(this.transform),this.addComponent(this.graphics),this.direction==="out"?this._currentProgress=0:this._currentProgress=1}get progress(){return this._currentProgress}get distance(){return this._currentDistance}get complete(){return this.direction==="out"?this.progress>=1:this.progress<=0}updateTransition(t,e){this.complete||(this._currentDistance+=B(e/this.duration,0,1),this._currentDistance>=1&&(this._currentDistance=1),this.direction==="out"?this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,0,1,1),0,1):this._currentProgress=B(ot(0,1,this.easing(this._currentDistance)),0,1):this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,1,0,1),0,1):this._currentProgress=B(ot(1,0,this.easing(this._currentDistance)),0,1))}async onPreviousSceneDeactivate(t){}onStart(t){}onUpdate(t){}onEnd(t){}onReset(){}reset(){this.started=!1,this._completeFuture=new wt,this.done=this._completeFuture.promise,this._currentDistance=0,this.direction==="out"?this._currentProgress=0:this._currentProgress=1,this.onReset()}_addToTargetScene(t,e){const i=e;if(this.started&&this._logger.warn(`Attempted to add a transition ${this.name} that is already playing.`),i.world.entityManager.getById(this.id))return this._co;this._engine=t,i.add(this);const s=this;return this._co=Ta(t,function*(){for(;!s.complete;){const n=yield;s.updateTransition(s._engine,n),s._execute()}},{autostart:!1}),this._co}async _play(){this.started&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that is already playing, reset transition.`)),(!this._engine||!this._co)&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that hasn't been added`)),this._co&&await this._co.start()}_execute(){this.isInitialized&&(this.started||(this.started=!0,this.onStart(this.progress)),this.onUpdate(this.progress),this.complete&&!this._completeFuture.isCompleted&&(this.onEnd(this.progress),this._completeFuture.resolve()))}}class _c extends cs{constructor(t){var e,i;super({...t,duration:(e=t.duration)!=null?e:2e3}),this.name=`FadeInOut#${this.id}`,this.color=(i=t.color)!=null?i:T.Black}onInitialize(t){this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=new ui({width:t.screen.resolution.width,height:t.screen.resolution.height,color:this.color}),this.graphics.add(this.screenCover),this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=t}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class fc extends cs{constructor(t){super({direction:"in",...t}),this.name=`CrossFade#${this.id}`}async onPreviousSceneDeactivate(t){this.image=await t.engine.screenshot(!0),await this.image.decode()}onInitialize(t){this.engine=t,this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=qt.fromHtmlImageElement(this.image).toSprite(),this.graphics.add(this.screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio),this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class gc extends cs{constructor(t){var e;super({direction:"in",...t}),this._easing=Rt.Linear,this._start=w.Zero,this._end=w.Zero,this.name=`Slide#${this.id}`,this.slideDirection=t.slideDirection,this.transform.coordPlane=rt.Screen,this.graphics.forceOnScreen=!0,this._easing=(e=t.easingFunction)!=null?e:this._easing}async onPreviousSceneDeactivate(t){this._image=await t.engine.screenshot(!0),await this._image.decode(),this._screenCover=qt.fromHtmlImageElement(this._image).toSprite()}onInitialize(t){this._engine=t;let e=t.screen.unsafeArea;switch(e.hasZeroDimensions()&&(e=t.screen.contentArea),this.slideDirection){case"up":{this._directionOffset=b(0,-e.height);break}case"down":{this._directionOffset=b(0,e.height);break}case"left":{this._directionOffset=b(-e.width,0);break}case"right":{this._directionOffset=b(e.width,0);break}}this._camera=this._engine.currentScene.camera,this._destinationCameraPosition=this._camera.pos.clone(),this._camera.pos=this._camera.pos.add(this._directionOffset),this.transform.pos=this.transform.pos.add(this._directionOffset),this._startCameraPosition=this._camera.pos.clone(),this._start=e.topLeft,this._end=this._start.add(this._directionOffset),this.transform.pos=this._start,this.graphics.use(this._screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio)}onStart(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}onUpdate(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}}const pc=Object.freeze(Object.defineProperty({__proto__:null,ConsoleAppender:Cs,DrawUtil:zh,EasingFunctions:Rt,LogLevel:Le,Logger:R,Observable:gt,ScreenAppender:mr,addItemToArray:Ch,contains:xr,delay:Fi,fail:br,getMinIndex:wr,getPosition:oi,isLegacyEasing:Te,isObject:Di,mergeDeep:Bi,omit:yr,removeItemFromArray:He},Symbol.toStringTag,{value:"Module"})),Aa=5,ti={},mc=()=>{for(const r in ti)ti[r]=0},ds=(r,t)=>{const e=De.isEnabled("suppress-obsolete-message");ti[r]<Aa&&!e&&(R.getInstance().warn(r),console.trace&&t.showStackTrace&&console.trace()),ti[r]++};function vc(r){return r={message:"This feature will be removed in future versions of Excalibur.",alternateMethod:null,showStackTrace:!1,...r},function(t,e,i){if(i&&!(typeof i.value=="function"||typeof i.get=="function"||typeof i.set=="function"))throw new SyntaxError("Only classes/functions/getters/setters can be marked as obsolete");const n=`${`${t.name||""}${t.name&&e?".":""}${e||""}`} is marked obsolete: ${r.message}`+(r.alternateMethod?` Use ${r.alternateMethod} instead`:"");ti[n]||(ti[n]=0);const o=i?{...i}:t;if(!i){class a extends o{constructor(...l){ds(n,r),super(...l)}}return a}return i&&i.value?(o.value=function(){return ds(n,r),i.value.apply(this,arguments)},o):(i&&i.get&&(o.get=function(){return ds(n,r),i.get.apply(this,arguments)}),i&&i.set&&(o.set=function(){return ds(n,r),i.set.apply(this,arguments)}),o)}}class wc{constructor(){this._queue=[]}get length(){return this._queue.length}enqueue(){const t=new wt;return this._queue.push(t),t.promise}dequeue(t){this._queue.shift().resolve(t)}}class xc{constructor(t){this._count=t,this._waitQueue=new wc}get count(){return this._count}get waiting(){return this._waitQueue.length}async enter(){return this._count!==0?(this._count--,Promise.resolve()):this._waitQueue.enqueue()}exit(t=1){if(t!==0){for(;t!==0&&this._waitQueue.length!==0;)this._waitQueue.dequeue(null),t--;this._count+=t}}}const er="0.32.0-alpha.1589+bc6ab76";Fe(),d.ActionCompleteEvent=js,d.ActionContext=fi,d.ActionQueue=eo,d.ActionSequence=Kn,d.ActionStartEvent=Zs,d.ActionsComponent=Qe,d.ActionsSystem=Vn,d.ActivateEvent=Gs,d.Actor=kt,d.ActorEvents=Al,d.AddEvent=Qs,d.AddedComponent=Sh,d.AffineMatrix=Z,d.Animation=Ui,d.AnimationDirection=Br,d.AnimationEvents=Dh,d.AnimationStrategy=kr,d.ArcadeSolver=Fn,d.AudioContextFactory=pi,d.Axes=ea,d.Axis=Yo,d.BaseAlign=ln,d.BezierCurve=si,d.Blink=yo,d.BodyComponent=N,d.BoundingBox=F,d.BrowserComponent=$n,d.BrowserEvents=da,d.Buttons=qn,d.Camera=Ko,d.CameraEvents=Ul,d.Canvas=Xi,d.ChannelCollection=xa,d.Circle=qi,d.CircleCollider=dt,d.Clock=Zn,d.ClosestLineJumpTable=Vt,d.Collider=ai,d.ColliderComponent=tt,d.CollisionContact=xe,d.CollisionEndEvent=ri,d.CollisionGroup=me,d.CollisionGroupManager=Pi,d.CollisionJumpTable=zt,d.CollisionPostSolveEvent=Mi,d.CollisionPreSolveEvent=Ri,d.CollisionStartEvent=ni,d.CollisionSystem=Qi,d.CollisionType=M,d.Color=T,d.ColorBlindFlags=la,d.ColorBlindnessMode=$e,d.ColorBlindnessPostProcessor=Qr,d.Component=Dt,d.CompositeCollider=at,d.ConsoleAppender=Cs,d.ContactConstraintPoint=Mo,d.ContactEndEvent=Ii,d.ContactSolveBias=ae,d.ContactStartEvent=Ei,d.CoordPlane=rt,d.CrossFade=fc,d.CurveBy=Eo,d.CurveTo=Po,d.DeactivateEvent=Vs,d.Debug=Tt,d.DebugConfig=ca,d.DebugGraphicsComponent=Wi,d.DebugSystem=Gn,d.DebugText=fn,d.DefaultAntialiasOptions=Or,d.DefaultGarbageCollectionOptions=Qn,d.DefaultLoader=mi,d.DefaultPixelArtOptions=Hr,d.DegreeOfFreedom=le,d.Delay=So,d.Detector=Oo,d.Die=To,d.Direction=dn,d.Director=pa,d.DirectorEvents=ga,d.DisplayMode=gi,d.DynamicTree=en,d.DynamicTreeCollisionProcessor=ki,d.EX_VERSION=er,d.EaseBy=bo,d.EaseTo=xo,d.EasingFunctions=Rt,d.Edge=ws,d.EdgeCollider=St,d.ElasticToActorStrategy=jo,d.EmitterType=Ee,d.Engine=as,d.EngineEvents=ql,d.EnterTriggerEvent=Ys,d.EnterViewPortEvent=Xs,d.Entity=At,d.EntityEvents=Eh,d.EntityManager=Sr,d.EventEmitter=X,d.EventTypes=Ts,d.Events=yh,d.ExResponse=Ln,d.ExcaliburGraphicsContext2DCanvas=Yi,d.ExcaliburGraphicsContextWebGL=$t,d.ExitTriggerEvent=$s,d.ExitViewPortEvent=qs,d.Fade=Co,d.FadeInOut=_c,d.Flags=De,d.Flash=Ao,d.Follow=Pn,d.Font=Se,d.FontCache=Vi,d.FontSource=dc,d.FontStyle=cn,d.FontUnit=an,d.FpsSampler=ua,d.FrameStats=yi,d.Future=wt,d.GameEvent=k,d.GameStartEvent=Is,d.GameStopEvent=Rs,d.Gamepad=ss,d.GamepadAxisEvent=Hs,d.GamepadButtonEvent=Os,d.GamepadConnectEvent=zs,d.GamepadDisconnectEvent=Us,d.Gamepads=is,d.GarbageCollector=wa,d.Gif=lc,d.GifParser=ya,d.GlobalCoordinates=ke,d.GpuParticleEmitter=$l,d.GpuParticleRenderer=hs,d.Graph=vs,d.Graphic=st,d.GraphicsComponent=K,d.GraphicsGroup=We,d.GraphicsSystem=pn,d.HashColliderProxy=Ro,d.HashGridCell=Zt,d.HashGridProxy=In,d.HiddenEvent=Ws,d.HorizontalFirst=nn,d.ImageFiltering=mt,d.ImageSource=qt,d.ImageSourceAttributeConstants=U,d.ImageWrapping=_t,d.InitializeEvent=Oe,d.InputHost=Yn,d.InputMapper=ia,d.IsometricEntityComponent=vi,d.IsometricEntitySystem=Wn,d.IsometricMap=zl,d.IsometricTile=qo,d.KeyEvent=wi,d.Keyboard=aa,d.Keys=oa,d.KillEvent=As,d.Label=Xl,d.LimitCameraBoundsStrategy=Jo,d.Line=gn,d.LineSegment=Q,d.Loader=Ki,d.LoaderEvents=Fl,d.LockCameraToActorAxisStrategy=Zo,d.LockCameraToActorStrategy=$o,d.LogLevel=Le,d.Logger=R,d.Material=Kr,d.Matrix=Ct,d.MatrixLocations=cr,d.MediaEvent=zn,d.Meet=Zi,d.MotionComponent=O,d.MotionSystem=ji,d.MoveBy=Tn,d.MoveByWithOptions=ro,d.MoveTo=An,d.MoveToWithOptions=ao,d.NativePointerButton=Pe,d.NativeSoundEvent=Ae,d.NativeSoundProcessedEvent=Lo,d.NineSlice=wn,d.NineSliceStretch=Ur,d.Node=Ti,d.None=rn,d.Observable=gt,d.OffscreenSystem=mn,d.Pair=pt,d.ParallaxComponent=Gi,d.ParallelActions=Zl,d.Particle=$i,d.ParticleEmitter=Yl,d.ParticleRenderer=Zr,d.ParticleTransform=Xt,d.PhysicsStats=rs,d.PhysicsWorld=Fo,d.PointerAbstraction=Xn,d.PointerButton=ce,d.PointerComponent=he,d.PointerEvent=xi,d.PointerEventReceiver=ns,d.PointerScope=Be,d.PointerSystem=es,d.PointerType=de,d.Polygon=vn,d.PolygonCollider=lt,d.Pool=zi,d.PositionNode=_r,d.PostCollisionEvent=we,d.PostDebugDrawEvent=Bs,d.PostDrawEvent=Ue,d.PostFrameEvent=Ls,d.PostKillEvent=Es,d.PostTransformDrawEvent=Fs,d.PostUpdateEvent=oe,d.PreCollisionEvent=ve,d.PreDebugDrawEvent=Ds,d.PreDrawEvent=ze,d.PreFrameEvent=ks,d.PreKillEvent=Ps,d.PreLoadEvent=Wl,d.PreTransformDrawEvent=Ms,d.PreUpdateEvent=re,d.Projection=ei,d.QuadIndexBuffer=Ze,d.QuadTree=Je,d.Query=Lt,d.QueryManager=Tr,d.RadiusAroundActorStrategy=Qo,d.Random=se,d.Raster=Ge,d.Ray=ge,d.RealisticSolver=Dn,d.Rectangle=ui,d.RemoveEvent=Js,d.RemovedComponent=Ah,d.RentalPool=qe,d.Repeat=io,d.RepeatForever=so,d.Resolution=Bn,d.Resource=li,d.ResourceEvents=Hh,d.RotateBy=uo,d.RotateByWithOptions=co,d.RotateTo=lo,d.RotateToWithOptions=ho,d.RotationType=j,d.ScaleBy=vo,d.ScaleByWithOptions=mo,d.ScaleTo=go,d.ScaleToWithOptions=fo,d.Scene=Mt,d.SceneEvents=Gl,d.Screen=kn,d.ScreenAppender=mr,d.ScreenElement=Hn,d.ScreenEvents=Pl,d.ScreenShader=jr,d.ScrollPreventionMode=Ke,d.Semaphore=xc,d.SeparatingAxis=Ne,d.SeparationInfo=Mr,d.Shader=Bt,d.Shape=ut,d.Slide=gc,d.SolverStrategy=Li,d.Sound=Un,d.SoundEvents=Rl,d.SoundManager=hc,d.SparseHashGrid=Rn,d.SparseHashGridCollisionProcessor=Mn,d.SpatialPartitionStrategy=hi,d.Sprite=Ut,d.SpriteFont=Oi,d.SpriteSheet=ye,d.StandardClock=jn,d.StateMachine=Ji,d.StrategyContainer=Xo,d.Stream=ba,d.System=Et,d.SystemManager=Pr,d.SystemPriority=Gt,d.SystemType=Pt,d.TagQuery=Ks,d.TestClock=_a,d.Text=_i,d.TextAlign=hn,d.TextureLoader=Xe,d.Tile=Vo,d.TileMap=Go,d.TileMapEvents=Ll,d.TiledAnimation=xn,d.TiledSprite=di,d.Timer=ts,d.Toaster=fa,d.Transform=Kt,d.TransformComponent=P,d.Transition=cs,d.TreeNode=tn,d.Trigger=ta,d.TriggerEvents=Ol,d.TwoPI=it,d.UniformBuffer=Nr,d.Util=pc,d.Vector=w,d.VectorView=ps,d.VertexBuffer=Ht,d.VertexLayout=Yt,d.VerticalFirst=sn,d.VisibleEvent=Ns,d.WebAudio=Bo,d.WebAudioInstance=ko,d.WheelDeltaMode=bi,d.WheelEvent=ha,d.World=Er,d.approximatelyEqual=ar,d.assert=Jn,d.canonicalizeAngle=Jt,d.clamp=B,d.coroutine=Ta,d.createId=fe,d.easeInBack=fh,d.easeInBounce=gr,d.easeInCirc=dh,d.easeInCubic=th,d.easeInElastic=mh,d.easeInExpo=hh,d.easeInOutBack=ph,d.easeInOutBounce=xh,d.easeInOutCirc=_h,d.easeInOutCubic=bs,d.easeInOutElastic=wh,d.easeInOutExpo=ch,d.easeInOutQuad=Ka,d.easeInOutQuart=nh,d.easeInOutQuint=ah,d.easeInOutSine=ja,d.easeInQuad=Qa,d.easeInQuart=ih,d.easeInQuint=rh,d.easeInSine=$a,d.easeOutBack=gh,d.easeOutBounce=ys,d.easeOutCirc=uh,d.easeOutCubic=eh,d.easeOutElastic=vh,d.easeOutExpo=lh,d.easeOutQuad=Ja,d.easeOutQuart=sh,d.easeOutQuint=oh,d.easeOutSine=Za,d.frac=Na,d.getDefaultPhysicsConfig=te,d.glTypeToUniformTypeName=Xr,d.hasGraphicsTick=Sn,d.hasOnAdd=nc,d.hasOnInitialize=Kl,d.hasOnPostUpdate=sc,d.hasOnPreUpdate=ec,d.hasOnRemove=rc,d.hasPostDraw=ac,d.hasPreDraw=oc,d.has_add=Ql,d.has_initialize=jl,d.has_postupdate=ic,d.has_preupdate=tc,d.has_remove=Jl,d.inverseLerp=dr,d.inverseLerpVector=ur,d.isActor=Tl,d.isAddedComponent=Th,d.isComponentCtor=vr,d.isLegacyEasing=Te,d.isLoaderConstructor=On,d.isMoveByOptions=no,d.isMoveToOptions=oo,d.isRemovedComponent=Ph,d.isRotateByOptions=Sl,d.isRotateToOptions=Cl,d.isScaleByOptions=po,d.isScaleToOptions=_o,d.isSceneConstructor=jt,d.isScreenElement=Ho,d.isSystemConstructor=Ar,d.lerp=ot,d.lerpAngle=ms,d.lerpVector=ii,d.linear=Ai,d.maxMessages=Aa,d.nextActionId=H,d.obsolete=vc,d.parseImageFiltering=Ve,d.parseImageWrapping=Ot,d.pixelSnapEpsilon=D,d.randomInRange=Nt,d.randomIntInRange=Va,d.range=Ga,d.remap=Wt,d.remapVector=qa,d.resetObsoleteCounter=mc,d.sign=V,d.smootherstep=Ya,d.smoothstep=Xa,d.toDegrees=hr,d.toRadians=Wa,d.vec=b,d.webgl=Yh,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -928,4 +928,4 @@ If in Firefox, visit about:config
|
|
|
928
928
|
|
|
929
929
|
Read more about this issue at https://excaliburjs.com/docs/performance`),i&&this._toaster.toast("Excalibur is encountering performance issues. It's possible that your browser doesn't have hardware acceleration enabled. Visit [LINK] for more information and potential solutions.","https://excaliburjs.com/docs/performance"),this.useCanvas2DFallback(),this.emit("fallbackgraphicscontext",this.graphicsContext))}}useCanvas2DFallback(){var t,e,i;const s=this.canvas.cloneNode(!1);this.canvas.parentNode.replaceChild(s,this.canvas),this.canvas=s;const n={...this._originalOptions,antialiasing:this.screen.antialiasing},o=this._originalDisplayMode;this.graphicsContext=new Yi({canvasElement:this.canvas,enableTransparency:this.enableCanvasTransparency,antialiasing:n.antialiasing,backgroundColor:n.backgroundColor,snapToPixel:n.snapToPixel,useDrawSorting:n.useDrawSorting}),this.screen&&this.screen.dispose(),this.screen=new kn({canvas:this.canvas,context:this.graphicsContext,antialiasing:(t=n.antialiasing)!=null?t:!0,browser:this.browser,viewport:(e=n.viewport)!=null?e:n.width&&n.height?{width:n.width,height:n.height}:Bn.SVGA,resolution:n.resolution,displayMode:o,pixelRatio:n.suppressHiDPIScaling?1:(i=n.pixelRatio)!=null?i:null}),this.screen.setCurrentCamera(this.currentScene.camera),this.input.pointers.detach();const a=n&&n.pointerScope===Be.Document?document:this.canvas;this.input.pointers=this.input.pointers.recreate(a,this),this.input.pointers.init()}dispose(){this._disposed||(this._disposed=!0,this.stop(),this._garbageCollector.forceCollectAll(),this.input.toggleEnabled(!1),this._hasCreatedCanvas&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null,this.screen.dispose(),this.graphicsContext.dispose(),this.graphicsContext=null,_e.InstanceCount--)}isDisposed(){return this._disposed}getWorldBounds(){return this.screen.getWorldBounds()}get timescale(){return this._timescale}set timescale(t){if(t<0){R.getInstance().warnOnce("engine.timescale to a value less than 0 are ignored");return}this._timescale=t}addTimer(t){return this.currentScene.addTimer(t)}removeTimer(t){return this.currentScene.removeTimer(t)}addScene(t,e){return this.director.add(t,e),this}removeScene(t){this.director.remove(t)}add(t){if(arguments.length===2){this.director.add(arguments[0],arguments[1]);return}const e=this.director.getDeferredScene();e instanceof Mt?e.add(t):this.currentScene.add(t)}remove(t){t instanceof At&&this.currentScene.remove(t),(t instanceof Mt||jt(t))&&this.removeScene(t),typeof t=="string"&&this.removeScene(t)}async goToScene(t,e){await this.scope(async()=>{await this.director.goToScene(t,e)})}screenToWorldCoordinates(t){return this.screen.screenToWorldCoordinates(t)}worldToScreenCoordinates(t){return this.screen.worldToScreenCoordinates(t)}_initialize(t){var e,i;this.pageScrollPreventionMode=t.scrollPreventionMode;const s=t&&t.pointerScope===Be.Document?document:this.canvas,n=(i=(e=this._originalOptions)==null?void 0:e.grabWindowFocus)!=null?i:!0;this.input=new Yn({global:this.global,pointerTarget:s,grabWindowFocus:n,engine:this}),this.inputMapper=this.input.inputMapper,this.browser.document.on("visibilitychange",()=>{document.visibilityState==="hidden"?(this.events.emit("hidden",new Ws(this)),this._logger.debug("Window hidden")):document.visibilityState==="visible"&&(this.events.emit("visible",new Ns(this)),this._logger.debug("Window visible"))}),!this.canvasElementId&&!t.canvasElement&&document.body.appendChild(this.canvas)}toggleInputEnabled(t){this._inputEnabled=t,this.input.toggleEnabled(this._inputEnabled)}onInitialize(t){}get isInitialized(){return this._isInitialized}async _overrideInitialize(t){this.isInitialized||(await this.director.onInitialize(),await this.onInitialize(t),this.events.emit("initialize",new Oe(t,this)),this._isInitialized=!0)}_update(t){var e;if(this._isLoading){(e=this._loader)==null||e.onUpdate(this,t),this.input.update();return}this.clock.__runScheduledCbs("preupdate"),this._preupdate(t),this.currentScene.update(this,t),this.graphicsContext.updatePostProcessors(t),this.clock.__runScheduledCbs("postupdate"),this._postupdate(t),this.input.update()}_preupdate(t){this.emit("preupdate",new re(this,t,this)),this.onPreUpdate(this,t)}onPreUpdate(t,e){}_postupdate(t){this.emit("postupdate",new oe(this,t,this)),this.onPostUpdate(this,t)}onPostUpdate(t,e){}_draw(t){var e,i;if(this.graphicsContext.backgroundColor=(e=this.currentScene.backgroundColor)!=null?e:this.backgroundColor,this.graphicsContext.beginDrawLifecycle(),this.graphicsContext.clear(),this.clock.__runScheduledCbs("predraw"),this._predraw(this.graphicsContext,t),this._isLoading){this._hideLoader||((i=this._loader)==null||i.canvas.draw(this.graphicsContext,0,0),this.clock.__runScheduledCbs("postdraw"),this.graphicsContext.flush(),this.graphicsContext.endDrawLifecycle());return}this.currentScene.draw(this.graphicsContext,t),this.clock.__runScheduledCbs("postdraw"),this._postdraw(this.graphicsContext,t),this.graphicsContext.flush(),this.graphicsContext.endDrawLifecycle(),this._checkForScreenShots()}_predraw(t,e){this.emit("predraw",new ze(t,e,this)),this.onPreDraw(t,e)}onPreDraw(t,e){}_postdraw(t,e){this.emit("postdraw",new Ue(t,e,this)),this.onPostDraw(t,e)}onPostDraw(t,e){}showDebug(t){this._isDebug=t}toggleDebug(){return this._isDebug=!this._isDebug,this._isDebug}get loadingComplete(){return!this._isLoading}get ready(){return this._isReadyFuture.isCompleted}isReady(){return this._isReadyFuture.promise}async start(t,e){await this.scope(async()=>{if(!this._compatible)throw new Error("Excalibur is incompatible with your browser");this._isLoading=!0;let i;return t instanceof mi?i=t:typeof t=="string"&&(this.director.configureStart(t,e),i=this.director.mainLoader),this._logger.debug("Starting game clock..."),this.browser.resume(),this.clock.start(),this.garbageCollectorConfig&&this._garbageCollector.start(),this._logger.debug("Game clock started"),await this.load(i!=null?i:new Ki),await this._overrideInitialize(this),this._isReadyFuture.resolve(),this.emit("start",new Is(this)),this._isReadyFuture.promise})}_mainloop(t){this.scope(()=>{this.emit("preframe",new ks(this,this.stats.prevFrame));const e=t*this.timescale;this.currentFrameElapsedMs=e;const i=this.stats.prevFrame.id+1;this.stats.currFrame.reset(),this.stats.currFrame.id=i,this.stats.currFrame.elapsedMs=e,this.stats.currFrame.fps=this.clock.fpsSampler.fps,J.clear();const s=this.clock.now(),n=this.fixedUpdateTimestep;if(this.fixedUpdateTimestep)for(this._lagMs+=e;this._lagMs>=n;)this._update(n),this._lagMs-=n;else this._update(e);const o=this.clock.now();this.currentFrameLagMs=this._lagMs,this._draw(e);const a=this.clock.now();this.stats.currFrame.duration.update=o-s,this.stats.currFrame.duration.draw=a-o,this.stats.currFrame.graphics.drawnImages=J.DrawnImagesCount,this.stats.currFrame.graphics.drawCalls=J.DrawCallCount,this.emit("postframe",new Ls(this,this.stats.currFrame)),this.stats.prevFrame.reset(this.stats.currFrame),this._monitorPerformanceThresholdAndTriggerFallback()})}stop(){this.clock.isRunning()&&(this.emit("stop",new Rs(this)),this.browser.pause(),this.clock.stop(),this._garbageCollector.stop(),this._logger.debug("Game stopped"))}isRunning(){return this.clock.isRunning()}screenshot(t=!1){return new Promise(i=>{this._screenShotRequests.push({preserveHiDPIResolution:t,resolve:i})})}_checkForScreenShots(){for(const t of this._screenShotRequests){const e=t.preserveHiDPIResolution?this.canvas.width:this.screen.resolution.width,i=t.preserveHiDPIResolution?this.canvas.height:this.screen.resolution.height,s=document.createElement("canvas");s.width=e,s.height=i;const n=s.getContext("2d");n.imageSmoothingEnabled=this.screen.antialiasing,n.drawImage(this.canvas,0,0,e,i);const o=new Image,a=s.toDataURL("image/png");o.onload=()=>{t.resolve(o)},o.src=a}this._screenShotRequests.length=0}async load(t,e=!1){await this.scope(async()=>{try{if(t.isLoaded())return;this._loader=t,this._isLoading=!0,this._hideLoader=e,t instanceof Ki&&(t.suppressPlayButton=t.suppressPlayButton||this._suppressPlayButton),this._loader.onInitialize(this),await t.load()}catch(i){this._logger.error("Error loading resources, things may not behave properly",i),await Promise.resolve()}finally{this._isLoading=!1,this._hideLoader=!1,this._loader=null}})}};os.Context=ma(),os.InstanceCount=0,os._DEFAULT_ENGINE_OPTIONS={width:0,height:0,enableCanvasTransparency:!0,useDrawSorting:!0,configurePerformanceCanvas2DFallback:{allow:!1,showPlayerMessage:!1,threshold:{fps:20,numberOfFrames:100}},canvasElementId:"",canvasElement:void 0,enableCanvasContextMenu:!1,snapToPixel:!1,antialiasing:!0,pixelArt:!1,garbageCollection:!0,powerPreference:"high-performance",pointerScope:Be.Canvas,suppressConsoleBootMessage:null,suppressMinimumBrowserFeatureDetection:null,suppressHiDPIScaling:null,suppressPlayButton:null,grabWindowFocus:!0,scrollPreventionMode:1,backgroundColor:T.fromHex("#2185d0")};let as=os;class Xl extends kt{constructor(t){super(t),this._font=new Se,this._text=new _i({text:"",font:this._font});const{text:e,pos:i,x:s,y:n,spriteFont:o,font:a,color:h,maxWidth:l}={text:"",...t};this.pos=i!=null?i:s&&n?b(s,n):this.pos,this.text=e!=null?e:this.text,this.font=a!=null?a:this.font,this.maxWidth=l!=null?l:this.maxWidth,this.spriteFont=o!=null?o:this.spriteFont,this._text.color=h!=null?h:this.color;const c=this.get(K);c.anchor=w.Zero,c.use(this._text)}set maxWidth(t){this._text.maxWidth=t}get maxWidth(){return this._text.maxWidth}get font(){return this._font}set font(t){this._font=t,this._text.font=t}get text(){return this._text.text}set text(t){this._text.text=t}get color(){return this._text.color}set color(t){this._text&&(this._text.color=t)}get opacity(){return this.graphics.opacity}set opacity(t){this.graphics.opacity=t}get spriteFont(){return this._spriteFont}set spriteFont(t){t&&(this._spriteFont=t,this._text.font=this._spriteFont)}_initialize(t){super._initialize(t)}getTextWidth(){return this._text.width}}var Ee=(r=>(r.Circle="circle",r.Rectangle="rectangle",r))(Ee||{});class Yl extends kt{constructor(t){var e,i;super({width:(e=t.width)!=null?e:0,height:(i=t.height)!=null?i:0}),this._particlesToEmit=0,this._particlePool=new qe(()=>new $i({}),m=>m,500),this.numParticles=0,this.isEmitting=!0,this.deadParticles=[],this.emitRate=1,this.emitterType=Ee.Rectangle,this.radius=0,this.particle={life:2e3,transform:Xt.Global,graphic:void 0,opacity:1,angularVelocity:0,focus:void 0,focusAccel:void 0,randomRotation:!1},this._activeParticles=[];const{particle:s,x:n,y:o,z:a,pos:h,isEmitting:l,emitRate:c,emitterType:u,radius:_,random:f}={...t};this.particle={...this.particle,...s},this.pos=h!=null?h:b(n!=null?n:0,o!=null?o:0),this.z=a!=null?a:0,this.isEmitting=l!=null?l:this.isEmitting,this.emitRate=c!=null?c:this.emitRate,this.emitterType=u!=null?u:this.emitterType,this.radius=_!=null?_:this.radius,this.body.collisionType=M.PreventCollision,this.random=f!=null?f:new se}removeParticle(t){this.deadParticles.push(t)}emitParticles(t){var e;if(!(t<=0)){t=t|0;for(let i=0;i<t;i++){const s=this._createParticle();(e=this==null?void 0:this.scene)!=null&&e.world&&(this.particle.transform===Xt.Global?this.scene.world.add(s):this.addChild(s)),this._activeParticles.push(s)}}}clearParticles(){for(let t=0;t<this._activeParticles.length;t++)this.removeParticle(this._activeParticles[t])}_createParticle(){let t=0,e=0;const i=Nt(this.particle.minAngle||0,this.particle.maxAngle||Math.PI*2,this.random),s=Nt(this.particle.minSpeed||0,this.particle.maxSpeed||0,this.random),n=this.particle.startSize||Nt(this.particle.minSize||5,this.particle.maxSize||5,this.random),o=s*Math.cos(i),a=s*Math.sin(i);if(this.emitterType===Ee.Rectangle)t=Nt(0,this.width,this.random),e=Nt(0,this.height,this.random);else if(this.emitterType===Ee.Circle){const l=Nt(0,this.radius,this.random);t=l*Math.cos(i),e=l*Math.sin(i)}const h=this._particlePool.rent();return h.unparent(),h.configure({transform:this.particle.transform,life:this.particle.life,opacity:this.particle.opacity,beginColor:this.particle.beginColor,endColor:this.particle.endColor,pos:b(t,e),z:this.particle.transform===Xt.Global?this.z:void 0,vel:b(o,a),acc:this.particle.acc,angularVelocity:this.particle.angularVelocity,startSize:this.particle.startSize,endSize:this.particle.endSize,size:n,graphic:this.particle.graphic,fade:this.particle.fade}),h.registerEmitter(this),this.particle.randomRotation&&(h.transform.rotation=Nt(0,Math.PI*2,this.random)),this.particle.focus&&(h.focus=this.particle.focus.add(b(this.pos.x,this.pos.y)),h.focusAccel=this.particle.focusAccel),h}update(t,e){var i;super.update(t,e),this.isEmitting&&(this._particlesToEmit+=this.emitRate*(e/1e3),this._particlesToEmit>1&&(this.emitParticles(Math.floor(this._particlesToEmit)),this._particlesToEmit=this._particlesToEmit-Math.floor(this._particlesToEmit)));for(let s=0;s<this.deadParticles.length;s++){(i=this==null?void 0:this.scene)!=null&&i.world&&(this.scene.world.remove(this.deadParticles[s],!1),this._particlePool.return(this.deadParticles[s]));const n=this._activeParticles.indexOf(this.deadParticles[s]);n>-1&&this._activeParticles.splice(n,1)}this.deadParticles.length=0}}function Jn(r,t){if(!t())throw new Error(r)}class hs{constructor(t,e,i){this.emitRate=1,this._initialized=!1,this._vaos=[],this._buffers=[],this._drawIndex=0,this._numInputFloats=7,this._particleIndex=0,this._uploadIndex=0,this._wrappedLife=0,this._wrappedParticles=0,this._particleLife=0,this._clearRequested=!1,this._emitted=[];var s;this.emitter=t,this.particle=i,this._particleData=new Float32Array(this.emitter.maxParticles*this._numInputFloats),this._random=e,this._particleLife=(s=this.particle.life)!=null?s:2e3}get isInitialized(){return this._initialized}get maxParticles(){return this.emitter.maxParticles}initialize(t,e){if(this._initialized)return;const i=this.emitter.maxParticles,s=this._numInputFloats,n=this._particleData,o=4,a=t.createBuffer(),h=t.createVertexArray();t.bindVertexArray(h),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,i*s*o,t.DYNAMIC_DRAW),t.bufferSubData(t.ARRAY_BUFFER,0,n);let l=0;t.vertexAttribPointer(0,2,t.FLOAT,!1,s*o,0),l+=o*2,t.vertexAttribPointer(1,2,t.FLOAT,!1,s*o,l),l+=o*2,t.vertexAttribPointer(2,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(3,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(4,1,t.FLOAT,!1,s*o,l),l+=o*1,t.enableVertexAttribArray(0),t.enableVertexAttribArray(1),t.enableVertexAttribArray(2),t.enableVertexAttribArray(3),t.enableVertexAttribArray(4),this._vaos.push(h),this._buffers.push(a),t.bindVertexArray(null),t.bindBuffer(t.ARRAY_BUFFER,null);const c=t.createBuffer(),u=t.createVertexArray();t.bindVertexArray(u),t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,i*s*o,t.DYNAMIC_DRAW),l=0,t.vertexAttribPointer(0,2,t.FLOAT,!1,s*o,0),l+=o*2,t.vertexAttribPointer(1,2,t.FLOAT,!1,s*o,l),l+=o*2,t.vertexAttribPointer(2,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(3,1,t.FLOAT,!1,s*o,l),l+=o*1,t.vertexAttribPointer(4,1,t.FLOAT,!1,s*o,l),l+=o*1,t.enableVertexAttribArray(0),t.enableVertexAttribArray(1),t.enableVertexAttribArray(2),t.enableVertexAttribArray(3),t.enableVertexAttribArray(4),this._vaos.push(u),this._buffers.push(c),t.bindVertexArray(null),t.bindBuffer(t.ARRAY_BUFFER,null),this._currentVao=this._vaos[this._drawIndex%2],this._currentBuffer=this._buffers[(this._drawIndex+1)%2],this._initialized=!0}clearParticles(){this._particleData.fill(0),this._clearRequested=!0}emitParticles(t){const e=this._particleIndex,i=this.maxParticles*this._numInputFloats,s=t*this._numInputFloats+e;for(let n=e;n<s;n+=this._numInputFloats){let o=this._random.floating(this.particle.minAngle||0,this.particle.maxAngle||it);o+=this.particle.transform===Xt.Local?this.emitter.transform.rotation:this.emitter.transform.globalRotation;const a=this._random.floating(this.particle.minSpeed||0,this.particle.maxSpeed||0),h=this._random.floating(this.particle.minSpeed||0,this.particle.maxSpeed||0),l=a*Math.cos(o),c=h*Math.sin(o);let u=0,_=0;if(this.emitter.emitterType===Ee.Rectangle)u=this._random.floating(-.5,.5)*this.emitter.width,_=this._random.floating(-.5,.5)*this.emitter.height;else{const p=this._random.floating(0,this.emitter.radius);u=p*Math.cos(o),_=p*Math.sin(o)}const f=this.emitter.transform.apply(b(u,_)),m=[this.particle.transform===Xt.Local?u:f.x,this.particle.transform===Xt.Local?_:f.y,l,c,this.particle.randomRotation?Nt(0,it,this._random):this.particle.rotation||0,this.particle.angularVelocity||0,this._particleLife];this._particleData.set(m,n%this._particleData.length)}s>=i?(this._wrappedParticles+=(s-i)/this._numInputFloats,this._wrappedLife=this._particleLife):this._wrappedLife>0&&(this._wrappedParticles+=t),this._particleIndex=s%i,this._emitted.push([this._particleLife,e])}_uploadEmitted(t){this._particleIndex!==this._uploadIndex&&(t.bindBuffer(t.ARRAY_BUFFER,this._buffers[(this._drawIndex+1)%2]),this._particleIndex>=this._uploadIndex?t.bufferSubData(t.ARRAY_BUFFER,this._uploadIndex*4,this._particleData,this._uploadIndex,this._particleIndex-this._uploadIndex):(t.bufferSubData(t.ARRAY_BUFFER,this._uploadIndex*4,this._particleData,this._uploadIndex,this._particleData.length-this._uploadIndex),this._wrappedParticles&&t.bufferSubData(t.ARRAY_BUFFER,0,this._particleData,0,this._wrappedParticles*this._numInputFloats),this._wrappedLife=this._particleLife),t.bindBuffer(t.ARRAY_BUFFER,null)),this._uploadIndex=this._particleIndex%(this.maxParticles*this._numInputFloats)}update(t){var e;if(this._particleLife=(e=this.particle.life)!=null?e:this._particleLife,this._wrappedLife>0?this._wrappedLife-=t:(this._wrappedLife=0,this._wrappedParticles=0),!!this._emitted.length){for(let i=this._emitted.length-1;i>=0;i--){const s=this._emitted[i];s[0]-=t,s[0]<=0&&this._emitted.splice(i,1)}this._emitted.sort((i,s)=>i[0]-s[0])}}draw(t){if(this._initialized){if(this._clearRequested?(t.bindBuffer(t.ARRAY_BUFFER,this._buffers[(this._drawIndex+1)%2]),t.bufferSubData(t.ARRAY_BUFFER,0,this._particleData),t.bindBuffer(t.ARRAY_BUFFER,null),this._clearRequested=!1):this._uploadEmitted(t),t.bindVertexArray(this._currentVao),t.bindBufferBase(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer),this._wrappedLife&&this._emitted[0]&&this._emitted[0][1]>0){const e=this._emitted[0][1]/this._numInputFloats;Jn(`midpoint greater than 0, actual: ${e}`,()=>e>0),Jn(`midpoint is less than max, actual: ${e}`,()=>e<this.maxParticles),t.bindBufferRange(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer,this._emitted[0][1]*4,(this.maxParticles-e)*this._numInputFloats*4),t.beginTransformFeedback(t.POINTS),t.drawArrays(t.POINTS,e,this.maxParticles-e),t.endTransformFeedback(),t.bindBufferRange(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer,0,this._emitted[0][1]*4),t.beginTransformFeedback(t.POINTS),t.drawArrays(t.POINTS,0,e),t.endTransformFeedback()}else t.bindBufferRange(t.TRANSFORM_FEEDBACK_BUFFER,0,this._currentBuffer,0,this._particleData.length*4),t.beginTransformFeedback(t.POINTS),t.drawArrays(t.POINTS,0,this.maxParticles),t.endTransformFeedback();t.bindVertexArray(null),t.bindBufferBase(t.TRANSFORM_FEEDBACK_BUFFER,0,null),this._currentVao=this._vaos[this._drawIndex%2],this._currentBuffer=this._buffers[(this._drawIndex+1)%2],this._drawIndex=(this._drawIndex+1)%2}}}hs.GPU_MAX_PARTICLES=1e5;class $l extends kt{constructor(t){super({name:"GpuParticleEmitter",width:t.width,height:t.height}),this.particle={life:2e3,transform:Xt.Global,graphic:void 0,opacity:1,angularVelocity:0,focus:void 0,focusAccel:void 0,randomRotation:!1},this.graphics=new K,this.isEmitting=!1,this.emitRate=1,this.emitterType=Ee.Rectangle,this.radius=0,this.maxParticles=2e3,this._particlesToEmit=0,this.addComponent(this.graphics,!0),this.graphics.onPostDraw=this.draw.bind(this);const{particle:e,maxParticles:i,x:s,y:n,z:o,pos:a,isEmitting:h,emitRate:l,emitterType:c,radius:u,random:_}={...t};this.maxParticles=B(i!=null?i:this.maxParticles,0,hs.GPU_MAX_PARTICLES),this.pos=a!=null?a:b(s!=null?s:0,n!=null?n:0),this.z=o!=null?o:0,this.isEmitting=h!=null?h:this.isEmitting,this.emitRate=l!=null?l:this.emitRate,this.emitterType=c!=null?c:this.emitterType,this.radius=u!=null?u:this.radius,this.particle={...this.particle,...e},this.random=_!=null?_:new se,this.renderer=new hs(this,this.random,this.particle)}get pos(){return this.transform.pos}set pos(t){this.transform.pos=t}get z(){return this.transform.z}set z(t){this.transform.z=t}_initialize(t){super._initialize(t);const e=t.graphicsContext;this.renderer.initialize(e.__gl,e)}update(t,e){super.update(t,e),this.isEmitting&&(this._particlesToEmit+=this.emitRate*(e/1e3),this._particlesToEmit>1&&(this.emitParticles(Math.floor(this._particlesToEmit)),this._particlesToEmit=this._particlesToEmit-Math.floor(this._particlesToEmit))),this.renderer.update(e)}emitParticles(t){t<=0||this.renderer.emitParticles(t|0)}clearParticles(){this.renderer.clearParticles()}draw(t,e){t.draw("ex.particle",this.renderer,e)}}class Kn{constructor(t,e){this.id=H(),this._stopped=!1,this._sequenceBuilder=e,this._sequenceContext=new fi(t),this._actionQueue=this._sequenceContext.getQueue(),this._sequenceBuilder(this._sequenceContext)}update(t){this._actionQueue.update(t)}isComplete(){return this._stopped||this._actionQueue.isComplete()}stop(){this._stopped=!0}reset(){this._stopped=!1,this._actionQueue.reset()}clone(t){return new Kn(t,this._sequenceBuilder)}}class Zl{constructor(t){this.id=H(),this._actions=t}update(t){for(let e=0;e<this._actions.length;e++)this._actions[e].update(t)}isComplete(t){return this._actions.every(e=>e.isComplete(t))}reset(){this._actions.forEach(t=>t.reset())}stop(){this._actions.forEach(t=>t.stop())}}function jl(r){return!!r._initialize}function Ql(r){return!!r.onAdd}function Jl(r){return!!r.onRemove}function Kl(r){return!!r.onInitialize}function tc(r){return!!r._preupdate}function ec(r){return!!r.onPreUpdate}function ic(r){return!!r.onPostUpdate}function sc(r){return!!r.onPostUpdate}function nc(r){return!!r.onAdd}function rc(r){return!!r.onRemove}function oc(r){return!!r.onPreDraw}function ac(r){return!!r.onPostDraw}class xa{constructor(t,e){this.soundManager=e}stop(t){if(!t)return;const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)e[i].stop()}setVolume(t,e){const i=this.soundManager.getSoundsForChannel(t);for(const s of i)this.soundManager._isMuted(s)||this.soundManager.setVolume(t,e)}play(t,e){e!=null||(e=this.soundManager.defaultVolume);const i=[],s=new Set,n=this.soundManager.getSoundsForChannel(t);for(const o of n){if(s.has(o)||this.soundManager._isMuted(o))continue;const a=this.soundManager._getEffectiveVolume(o);i.push(o.play(a*e)),s.add(o)}return Promise.all(i)}mute(t){const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)this.soundManager._muted.add(e[i]),e[i].pause()}unmute(t){const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)this.soundManager._muted.has(e[i])&&(e[i].play(),this.soundManager._muted.delete(e[i]))}toggle(t){const e=this.soundManager.getSoundsForChannel(t);for(let i=0;i<e.length;i++)this.soundManager._isMuted(e[i])?(e[i].play(),this.soundManager._muted.delete(e[i])):(this.soundManager._muted.add(e[i]),e[i].pause())}}class hc{constructor(t){this._channelToConfig=new Map,this._nameToConfig=new Map,this._mix=new Map,this._muted=new Set,this._all=new Set,this._defaultVolume=1;var e;if(this._defaultVolume=(e=t.volume)!=null?e:1,this.channel=new xa(t,this),t.sounds)for(const[i,s]of Object.entries(t.sounds))this.track(i,s)}set defaultVolume(t){this._defaultVolume=B(t,0,1)}get defaultVolume(){return this._defaultVolume}getSounds(){return Array.from(this._all)}getSoundsForChannel(t){const e=this._channelToConfig.get(t);return e?e.sounds:[]}_isMuted(t){return this._muted.has(t)}_getEffectiveVolume(t){var e;if(this._isMuted(t))return 0;let i=this._defaultVolume;return this._mix.has(t)&&(i*=(e=this._mix.get(t))!=null?e:this._defaultVolume),i}play(t,e=this._defaultVolume){const i=this._nameToConfig.get(t);if(!i)return Promise.resolve();const{sound:s}=i;if(this._isMuted(s))return Promise.resolve();const n=e*this._getEffectiveVolume(s);return s.play(n)}getSound(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;return i}setVolume(t,e=this._defaultVolume){const i=this._nameToConfig.get(t);if(!i)return;const{sound:s}=i;this._setMix(s,e)}getVolume(t){var e;const i=this.getSound(t);return i&&(e=this._mix.get(i))!=null?e:0}_setMix(t,e){this._mix.set(t,e),t.volume=e}track(t,e){let i,s,n;e instanceof Un?(i=e,s=this._defaultVolume,n=[]):{sound:i,volume:s,channels:n}=e,this._nameToConfig.set(t,{sound:i,volume:s,channels:n}),this._mix.set(i,s!=null?s:this._defaultVolume),this._all.add(i),n&&this.addChannel(t,n)}untrack(t){this._nameToConfig.delete(t);const e=this.getSound(t);e&&(this._mix.delete(e),this._all.delete(e))}stop(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;i.stop();return}this._all.forEach(e=>e.stop())}mute(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;this._muted.add(i),i.pause();return}this._muted=new Set(this._all),this._muted.forEach(e=>e.pause())}unmute(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;i.play(),this._muted.delete(i);return}this._muted.forEach(e=>e.play()),this._muted.clear()}toggle(t){if(t){const e=this._nameToConfig.get(t);if(!e)return;const{sound:i}=e;this._isMuted(i)?this.unmute(t):this.mute(t);return}this._muted.size>0?(this._muted.forEach(e=>e.play()),this._muted.clear()):(this._muted=new Set(this._all),this._muted.forEach(e=>e.pause()))}addChannel(t,e){const i=this.getSound(t);if(!i)return;const s=this._mix.get(i);this._mix.set(i,s!=null?s:this._defaultVolume),this._all.add(i);for(const n of e){let o=this._channelToConfig.get(n);o||(o={sounds:[i]}),o.sounds.indexOf(i)===-1&&o.sounds.push(i),this._channelToConfig.set(n,o)}}removeChannel(t,e){const i=this.getSound(t);if(i)for(const s of e){const n=this._channelToConfig.get(s);if(!n)return;const o=n.sounds.indexOf(i);o>=-1&&n.sounds.splice(o,1),this._channelToConfig.set(s,n)}}}class lc{constructor(t,e=!1){this.path=t,this.width=0,this.height=0,this._images=[],this.data=[],this._sprites=[],this._resource=new li(t,"arraybuffer",e)}get bustCache(){return this._resource.bustCache}set bustCache(t){this._resource.bustCache=t}async load(){const t=await this._resource.load();this._stream=new ba(t),this._gif=new ya(this._stream);const e=this._gif.images.map(i=>new qt(i.src,!1));return await Promise.all(e.map(i=>i.load())),this.data=this._images=e,this._sprites=this._images.map(i=>i.toSprite()),this.data}isLoaded(){return!!this.data}toSprite(t=0){var e;return(e=this._sprites[t])!=null?e:null}toSpriteSheet(){const t=this._sprites;return t.length?new ye({sprites:t}):null}toAnimation(t){var e;const i=(e=this._gif)==null?void 0:e.images;if(i!=null&&i.length){const s=i.map((n,o)=>{var a;return{graphic:this._sprites[o],duration:((a=this._gif)==null?void 0:a.frames[o].delayMs)||void 0}});return this._animation=new Ui({frames:s,frameDuration:t}),this._animation}return null}get readCheckBytes(){var t,e;return(e=(t=this._gif)==null?void 0:t.checkBytes)!=null?e:[]}}const ls=r=>r.reduce(function(t,e){return t*2+e},0),tr=r=>{const t=[];for(let e=7;e>=0;e--)t.push(!!(r&1<<e));return t};class ba{constructor(t){if(this.len=0,this.position=0,this.readByte=()=>{if(this.position>=this.data.byteLength)throw new Error("Attempted to read past end of stream.");return this.data[this.position++]},this.readBytes=e=>{const i=[];for(let s=0;s<e;s++)i.push(this.readByte());return i},this.read=e=>{let i="";for(let s=0;s<e;s++)i+=String.fromCharCode(this.readByte());return i},this.readUnsigned=()=>{const e=this.readBytes(2);return(e[1]<<8)+e[0]},this.data=new Uint8Array(t),this.len=this.data.byteLength,this.len===0)throw new Error("No data loaded from file")}}const cc=function(r,t){let e=0;const i=function(_){let f=0;for(let m=0;m<_;m++)t.charCodeAt(e>>3)&1<<(e&7)&&(f|=1<<m),e++;return f},s=[],n=1<<r,o=n+1;let a=r+1,h=[];const l=function(){h=[],a=r+1;for(let _=0;_<n;_++)h[_]=[_];h[n]=[],h[o]=null};let c=0,u=0;for(;;){if(u=c,c=i(a),c===n){l();continue}if(c===o)break;if(c<h.length)u!==n&&h.push(h[u].concat(h[c][0]));else{if(c!==h.length)throw new Error("Invalid LZW code.");h.push(h[u].concat(h[u][0]))}s.push.apply(s,h[c]),h.length===1<<a&&a<12&&a++}return s};class ya{constructor(t){this._handler={},this.frames=[],this.images=[],this.globalColorTableBytes=[],this.checkBytes=[],this.parseColorTableBytes=e=>{const i=[];for(let s=0;s<e;s++){const n=this._st.readBytes(3);i.push(n)}return i},this.readSubBlocks=()=>{let e,i;i="";do e=this._st.readByte(),i+=this._st.read(e);while(e!==0);return i},this.parseHeader=()=>{const e={sig:"",ver:"",width:0,height:0,colorResolution:0,globalColorTableSize:0,gctFlag:!1,sortedFlag:!1,globalColorTable:[],backgroundColorIndex:0,pixelAspectRatio:0};if(e.sig=this._st.read(3),e.ver=this._st.read(3),e.sig!=="GIF")throw new Error("Not a GIF file.");e.width=this._st.readUnsigned(),e.height=this._st.readUnsigned(),this._currentFrameCanvas.width=e.width,this._currentFrameCanvas.height=e.height;const i=tr(this._st.readByte());e.gctFlag=i.shift(),e.colorResolution=ls(i.splice(0,3)),e.sortedFlag=i.shift(),e.globalColorTableSize=ls(i.splice(0,3)),e.backgroundColorIndex=this._st.readByte(),e.pixelAspectRatio=this._st.readByte(),e.gctFlag&&(this.globalColorTableBytes=this.parseColorTableBytes(1<<e.globalColorTableSize+1)),this._handler.hdr&&this._handler.hdr(e)&&this.checkBytes.push(this._handler.hdr)},this.parseExt=e=>{const i=h=>{this.checkBytes.push(this._st.readByte());const l=tr(this._st.readByte());return h.reserved=l.splice(0,3),h.disposalMethod=ls(l.splice(0,3)),h.userInputFlag=l.shift(),h.transparentColorFlag=l.shift(),h.delayTime=this._st.readUnsigned(),h.transparentColorIndex=this._st.readByte(),h.terminator=this._st.readByte(),this._handler.gce&&this._handler.gce(h)&&this.checkBytes.push(this._handler.gce),h},s=h=>{h.comment=this.readSubBlocks(),this._handler.com&&this._handler.com(h)&&this.checkBytes.push(this._handler.com)},n=h=>{this.checkBytes.push(this._st.readByte()),h.ptHeader=this._st.readBytes(12),h.ptData=this.readSubBlocks(),this._handler.pte&&this._handler.pte(h)&&this.checkBytes.push(this._handler.pte)},o=h=>{const l=u=>{this.checkBytes.push(this._st.readByte()),u.unknown=this._st.readByte(),u.iterations=this._st.readUnsigned(),u.terminator=this._st.readByte(),this._handler.app&&this._handler.app.NETSCAPE&&this._handler.app.NETSCAPE(u)&&this.checkBytes.push(this._handler.app)},c=u=>{u.appData=this.readSubBlocks(),this._handler.app&&this._handler.app[u.identifier]&&this._handler.app[u.identifier](u)&&this.checkBytes.push(this._handler.app[u.identifier])};switch(this.checkBytes.push(this._st.readByte()),h.identifier=this._st.read(8),h.authCode=this._st.read(3),h.identifier){case"NETSCAPE":l(h);break;default:c(h);break}},a=h=>{h.data=this.readSubBlocks(),this._handler.unknown&&this._handler.unknown(h)&&this.checkBytes.push(this._handler.unknown)};switch(e.label=this._st.readByte(),e.label){case 249:e.extType="gce",this._gce=i(e);break;case 254:e.extType="com",s(e);break;case 1:e.extType="pte",n(e);break;case 255:e.extType="app",o(e);break;default:e.extType="unknown",a(e);break}},this.parseImg=e=>{var i;const s=(a,h)=>{const l=new Array(a.length),c=a.length/h,u=(p,x)=>{const v=a.slice(x*h,(x+1)*h);l.splice.apply(l,[p*h,h].concat(v))},_=[0,4,2,1],f=[8,8,4,2];let m=0;for(let p=0;p<4;p++)for(let x=_[p];x<c;x+=f[p])u(x,m),m++;return l};e.leftPos=this._st.readUnsigned(),e.topPos=this._st.readUnsigned(),e.width=this._st.readUnsigned(),e.height=this._st.readUnsigned();const n=tr(this._st.readByte());e.lctFlag=n.shift(),e.interlaced=n.shift(),e.sorted=n.shift(),e.reserved=n.splice(0,2),e.lctSize=ls(n.splice(0,3)),e.lctFlag&&(e.lctBytes=this.parseColorTableBytes(1<<e.lctSize+1)),e.lzwMinCodeSize=this._st.readByte();const o=this.readSubBlocks();e.pixels=cc(e.lzwMinCodeSize,o),e.interlaced&&(e.pixels=s(e.pixels,e.width)),(i=this._gce)!=null&&i.delayTime&&(e.delayMs=this._gce.delayTime*10),this.frames.push(e),this.arrayToImage(e,e.lctFlag?e.lctBytes:this.globalColorTableBytes),this._handler.img&&this._handler.img(e)&&this.checkBytes.push(this._handler)},this.parseBlocks=()=>{const e={sentinel:this._st.readByte(),type:""};switch(String.fromCharCode(e.sentinel)){case"!":e.type="ext",this.parseExt(e);break;case",":e.type="img",this.parseImg(e);break;case";":e.type="eof",this._handler.eof&&this._handler.eof(e)&&this.checkBytes.push(this._handler.eof);break;default:throw new Error("Unknown block: 0x"+e.sentinel.toString(16))}e.type!=="eof"&&this.parseBlocks()},this.arrayToImage=(e,i)=>{var s,n,o,a;const h=document.createElement("canvas");h.width=e.width,h.height=e.height;const l=h.getContext("2d"),c=l.getImageData(0,0,h.width,h.height);let u=-1;(s=this._gce)!=null&&s.transparentColorFlag&&(u=this._gce.transparentColorIndex);for(let f=0;f<e.pixels.length;f++){const m=e.pixels[f],p=i[m];m===u?c.data.set([0,0,0,0],f*4):c.data.set([...p,255],f*4)}if(l.putImageData(c,0,0),((n=this._gce)==null?void 0:n.disposalMethod)===1&&this.images.length)this._currentFrameContext.drawImage(this.images[this.images.length-1],0,0);else if(((o=this._gce)==null?void 0:o.disposalMethod)===2&&((a=this._hdr)!=null&&a.gctFlag)){const f=i[this._hdr.backgroundColorIndex];this._currentFrameContext.fillStyle=`rgb(${f[0]}, ${f[1]}, ${f[2]})`,this._currentFrameContext.fillRect(0,0,this._hdr.width,this._hdr.height)}else this._currentFrameContext.clearRect(0,0,this._currentFrameCanvas.width,this._currentFrameCanvas.height);this._currentFrameContext.drawImage(h,e.leftPos,e.topPos,e.width,e.height);const _=new Image;_.src=this._currentFrameCanvas.toDataURL(),this.images.push(_)},this._st=t,this._handler={},this._currentFrameCanvas=document.createElement("canvas"),this._currentFrameContext=this._currentFrameCanvas.getContext("2d"),this.parseHeader(),this.parseBlocks()}}class dc{constructor(t,e,{bustCache:i,...s}={}){this.path=t,this.family=e,this._isLoaded=!1,this._resource=new li(t,"blob",i),this._options=s}async load(){if(this.isLoaded())return this.data;try{const t=await this._resource.load(),e=URL.createObjectURL(t);this.data||(this.data=new FontFace(this.family,`url(${e})`),document.fonts.add(this.data)),await this.data.load(),this._isLoaded=!0}catch(t){throw`Error loading FontSource from path '${this.path}' with error [${t.message}]`}return this.data}isLoaded(){return this._isLoaded}toFont(t){return new Se({family:this.family,...this._options,...t})}}const Ca=ma(),uc=/^\s*(?:function)?\*/;function Sa(r){return typeof r!="function"?!1:uc.test(Function.prototype.toString.call(r))?!0:Object.getPrototypeOf?Object.getPrototypeOf(r)===Object.getPrototypeOf(new Function("return function * () {}")()):!1}function Ta(...r){var t;const e=R.getInstance();let i,s,n,o;Sa(r[0])&&(s=globalThis,i=r[0],n=r[1]),Sa(r[1])&&(s=r[0],i=r[1],n=r[2]),r[1]instanceof as&&(s=r[0],o=r[1],i=r[2],n=r[3]),r[0]instanceof as&&(s=globalThis,o=r[0],i=r[1],n=r[2]);const a=va(Ca),h=n==null?void 0:n.timing,l=a?!1:(t=n==null?void 0:n.autostart)!=null?t:!0;let c;try{c=o!=null?o:as.useEngine()}catch(y){throw Error(`Cannot run coroutine without engine parameter outside of an excalibur lifecycle method.
|
|
930
930
|
Pass an engine parameter to ex.coroutine(engine, function * {...})`)}let u=!1,_=!1,f=!1;const m=i.bind(s),p=m();let x;const v=new Promise((y,S)=>{x=A=>{try{if(f){_=!0,y();return}const{done:I,value:C}=Ca.scope(!0,()=>p.next(A));if(I||f){_=!0,y();return}C instanceof Promise?C.then(()=>{c.clock.schedule(x,0,h)}):C===void 0||C===void 0?c.clock.schedule(x,0,h):c.clock.schedule(x,C||0,h)}catch(I){S(I);return}},l&&(u=!0,x(c.clock.elapsed()))}),g={isRunning:()=>u&&!f&&!_,isComplete:()=>_,cancel:()=>{f=!0},start:()=>(u?e.warn(`.start() was called on a coroutine that was already started, this is probably a bug:
|
|
931
|
-
`,Function.prototype.toString.call(m)):(u=!0,x(c.clock.elapsed())),g),generator:p,done:v,then:v.then.bind(v),[Symbol.iterator]:()=>p};return g}class cs extends At{constructor(t){var e,i,s,n,o;super(),this._logger=R.getInstance(),this.transform=new P,this.graphics=new K,this._completeFuture=new wt,this.started=!1,this._currentDistance=0,this._currentProgress=0,this.done=this._completeFuture.promise,this._useLegacyEasing=!1,this.name=`Transition#${this.id}`,this.duration=t.duration,Te(t.easing)?(this.legacyEasing=(e=t.easing)!=null?e:Rt.Linear,this._useLegacyEasing=!0):this.easing=(i=t.easing)!=null?i:Ai,this.direction=(s=t.direction)!=null?s:"out",this.hideLoader=(n=t.hideLoader)!=null?n:!1,this.blockInput=(o=t.blockInput)!=null?o:!1,this.transform.coordPlane=rt.Screen,this.transform.pos=w.Zero,this.transform.z=1/0,this.graphics.anchor=w.Zero,this.addComponent(this.transform),this.addComponent(this.graphics),this.direction==="out"?this._currentProgress=0:this._currentProgress=1}get progress(){return this._currentProgress}get distance(){return this._currentDistance}get complete(){return this.direction==="out"?this.progress>=1:this.progress<=0}updateTransition(t,e){this.complete||(this._currentDistance+=B(e/this.duration,0,1),this._currentDistance>=1&&(this._currentDistance=1),this.direction==="out"?this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,0,1,1),0,1):this._currentProgress=B(ot(0,1,this.easing(this._currentDistance)),0,1):this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,1,0,1),0,1):this._currentProgress=B(ot(1,0,this.easing(this._currentDistance)),0,1))}async onPreviousSceneDeactivate(t){}onStart(t){}onUpdate(t){}onEnd(t){}onReset(){}reset(){this.started=!1,this._completeFuture=new wt,this.done=this._completeFuture.promise,this._currentDistance=0,this.direction==="out"?this._currentProgress=0:this._currentProgress=1,this.onReset()}_addToTargetScene(t,e){const i=e;if(this.started&&this._logger.warn(`Attempted to add a transition ${this.name} that is already playing.`),i.world.entityManager.getById(this.id))return this._co;this._engine=t,i.add(this);const s=this;return this._co=Ta(t,function*(){for(;!s.complete;){const n=yield;s.updateTransition(s._engine,n),s._execute()}},{autostart:!1}),this._co}async _play(){this.started&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that is already playing, reset transition.`)),(!this._engine||!this._co)&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that hasn't been added`)),this._co&&await this._co.start()}_execute(){this.isInitialized&&(this.started||(this.started=!0,this.onStart(this.progress)),this.onUpdate(this.progress),this.complete&&!this._completeFuture.isCompleted&&(this.onEnd(this.progress),this._completeFuture.resolve()))}}class _c extends cs{constructor(t){var e,i;super({...t,duration:(e=t.duration)!=null?e:2e3}),this.name=`FadeInOut#${this.id}`,this.color=(i=t.color)!=null?i:T.Black}onInitialize(t){this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=new ui({width:t.screen.resolution.width,height:t.screen.resolution.height,color:this.color}),this.graphics.add(this.screenCover),this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=t}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class fc extends cs{constructor(t){super({direction:"in",...t}),this.name=`CrossFade#${this.id}`}async onPreviousSceneDeactivate(t){this.image=await t.engine.screenshot(!0),await this.image.decode()}onInitialize(t){this.engine=t,this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=qt.fromHtmlImageElement(this.image).toSprite(),this.graphics.add(this.screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio),this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class gc extends cs{constructor(t){var e;super({direction:"in",...t}),this._easing=Rt.Linear,this._start=w.Zero,this._end=w.Zero,this.name=`Slide#${this.id}`,this.slideDirection=t.slideDirection,this.transform.coordPlane=rt.Screen,this.graphics.forceOnScreen=!0,this._easing=(e=t.easingFunction)!=null?e:this._easing}async onPreviousSceneDeactivate(t){this._image=await t.engine.screenshot(!0),await this._image.decode(),this._screenCover=qt.fromHtmlImageElement(this._image).toSprite()}onInitialize(t){this._engine=t;let e=t.screen.unsafeArea;switch(e.hasZeroDimensions()&&(e=t.screen.contentArea),this.slideDirection){case"up":{this._directionOffset=b(0,-e.height);break}case"down":{this._directionOffset=b(0,e.height);break}case"left":{this._directionOffset=b(-e.width,0);break}case"right":{this._directionOffset=b(e.width,0);break}}this._camera=this._engine.currentScene.camera,this._destinationCameraPosition=this._camera.pos.clone(),this._camera.pos=this._camera.pos.add(this._directionOffset),this.transform.pos=this.transform.pos.add(this._directionOffset),this._startCameraPosition=this._camera.pos.clone(),this._start=e.topLeft,this._end=this._start.add(this._directionOffset),this.transform.pos=this._start,this.graphics.use(this._screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio)}onStart(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}onUpdate(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}}const pc=Object.freeze(Object.defineProperty({__proto__:null,ConsoleAppender:Cs,DrawUtil:zh,EasingFunctions:Rt,LogLevel:Le,Logger:R,Observable:gt,ScreenAppender:mr,addItemToArray:Ch,contains:xr,delay:Fi,fail:br,getMinIndex:wr,getPosition:oi,isLegacyEasing:Te,isObject:Di,mergeDeep:Bi,omit:yr,removeItemFromArray:He},Symbol.toStringTag,{value:"Module"})),Aa=5,ti={},mc=()=>{for(const r in ti)ti[r]=0},ds=(r,t)=>{const e=De.isEnabled("suppress-obsolete-message");ti[r]<Aa&&!e&&(R.getInstance().warn(r),console.trace&&t.showStackTrace&&console.trace()),ti[r]++};function vc(r){return r={message:"This feature will be removed in future versions of Excalibur.",alternateMethod:null,showStackTrace:!1,...r},function(t,e,i){if(i&&!(typeof i.value=="function"||typeof i.get=="function"||typeof i.set=="function"))throw new SyntaxError("Only classes/functions/getters/setters can be marked as obsolete");const n=`${`${t.name||""}${t.name&&e?".":""}${e||""}`} is marked obsolete: ${r.message}`+(r.alternateMethod?` Use ${r.alternateMethod} instead`:"");ti[n]||(ti[n]=0);const o=i?{...i}:t;if(!i){class a extends o{constructor(...l){ds(n,r),super(...l)}}return a}return i&&i.value?(o.value=function(){return ds(n,r),i.value.apply(this,arguments)},o):(i&&i.get&&(o.get=function(){return ds(n,r),i.get.apply(this,arguments)}),i&&i.set&&(o.set=function(){return ds(n,r),i.set.apply(this,arguments)}),o)}}class wc{constructor(){this._queue=[]}get length(){return this._queue.length}enqueue(){const t=new wt;return this._queue.push(t),t.promise}dequeue(t){this._queue.shift().resolve(t)}}class xc{constructor(t){this._count=t,this._waitQueue=new wc}get count(){return this._count}get waiting(){return this._waitQueue.length}async enter(){return this._count!==0?(this._count--,Promise.resolve()):this._waitQueue.enqueue()}exit(t=1){if(t!==0){for(;t!==0&&this._waitQueue.length!==0;)this._waitQueue.dequeue(null),t--;this._count+=t}}}const er="0.32.0-alpha.1587+0f92426";Fe(),d.ActionCompleteEvent=js,d.ActionContext=fi,d.ActionQueue=eo,d.ActionSequence=Kn,d.ActionStartEvent=Zs,d.ActionsComponent=Qe,d.ActionsSystem=Vn,d.ActivateEvent=Gs,d.Actor=kt,d.ActorEvents=Al,d.AddEvent=Qs,d.AddedComponent=Sh,d.AffineMatrix=Z,d.Animation=Ui,d.AnimationDirection=Br,d.AnimationEvents=Dh,d.AnimationStrategy=kr,d.ArcadeSolver=Fn,d.AudioContextFactory=pi,d.Axes=ea,d.Axis=Yo,d.BaseAlign=ln,d.BezierCurve=si,d.Blink=yo,d.BodyComponent=N,d.BoundingBox=F,d.BrowserComponent=$n,d.BrowserEvents=da,d.Buttons=qn,d.Camera=Ko,d.CameraEvents=Ul,d.Canvas=Xi,d.ChannelCollection=xa,d.Circle=qi,d.CircleCollider=dt,d.Clock=Zn,d.ClosestLineJumpTable=Vt,d.Collider=ai,d.ColliderComponent=tt,d.CollisionContact=xe,d.CollisionEndEvent=ri,d.CollisionGroup=me,d.CollisionGroupManager=Pi,d.CollisionJumpTable=zt,d.CollisionPostSolveEvent=Mi,d.CollisionPreSolveEvent=Ri,d.CollisionStartEvent=ni,d.CollisionSystem=Qi,d.CollisionType=M,d.Color=T,d.ColorBlindFlags=la,d.ColorBlindnessMode=$e,d.ColorBlindnessPostProcessor=Qr,d.Component=Dt,d.CompositeCollider=at,d.ConsoleAppender=Cs,d.ContactConstraintPoint=Mo,d.ContactEndEvent=Ii,d.ContactSolveBias=ae,d.ContactStartEvent=Ei,d.CoordPlane=rt,d.CrossFade=fc,d.CurveBy=Eo,d.CurveTo=Po,d.DeactivateEvent=Vs,d.Debug=Tt,d.DebugConfig=ca,d.DebugGraphicsComponent=Wi,d.DebugSystem=Gn,d.DebugText=fn,d.DefaultAntialiasOptions=Or,d.DefaultGarbageCollectionOptions=Qn,d.DefaultLoader=mi,d.DefaultPixelArtOptions=Hr,d.DegreeOfFreedom=le,d.Delay=So,d.Detector=Oo,d.Die=To,d.Direction=dn,d.Director=pa,d.DirectorEvents=ga,d.DisplayMode=gi,d.DynamicTree=en,d.DynamicTreeCollisionProcessor=ki,d.EX_VERSION=er,d.EaseBy=bo,d.EaseTo=xo,d.EasingFunctions=Rt,d.Edge=ws,d.EdgeCollider=St,d.ElasticToActorStrategy=jo,d.EmitterType=Ee,d.Engine=as,d.EngineEvents=ql,d.EnterTriggerEvent=Ys,d.EnterViewPortEvent=Xs,d.Entity=At,d.EntityEvents=Eh,d.EntityManager=Sr,d.EventEmitter=X,d.EventTypes=Ts,d.Events=yh,d.ExResponse=Ln,d.ExcaliburGraphicsContext2DCanvas=Yi,d.ExcaliburGraphicsContextWebGL=$t,d.ExitTriggerEvent=$s,d.ExitViewPortEvent=qs,d.Fade=Co,d.FadeInOut=_c,d.Flags=De,d.Flash=Ao,d.Follow=Pn,d.Font=Se,d.FontCache=Vi,d.FontSource=dc,d.FontStyle=cn,d.FontUnit=an,d.FpsSampler=ua,d.FrameStats=yi,d.Future=wt,d.GameEvent=k,d.GameStartEvent=Is,d.GameStopEvent=Rs,d.Gamepad=ss,d.GamepadAxisEvent=Hs,d.GamepadButtonEvent=Os,d.GamepadConnectEvent=zs,d.GamepadDisconnectEvent=Us,d.Gamepads=is,d.GarbageCollector=wa,d.Gif=lc,d.GifParser=ya,d.GlobalCoordinates=ke,d.GpuParticleEmitter=$l,d.GpuParticleRenderer=hs,d.Graph=vs,d.Graphic=st,d.GraphicsComponent=K,d.GraphicsGroup=We,d.GraphicsSystem=pn,d.HashColliderProxy=Ro,d.HashGridCell=Zt,d.HashGridProxy=In,d.HiddenEvent=Ws,d.HorizontalFirst=nn,d.ImageFiltering=mt,d.ImageSource=qt,d.ImageSourceAttributeConstants=U,d.ImageWrapping=_t,d.InitializeEvent=Oe,d.InputHost=Yn,d.InputMapper=ia,d.IsometricEntityComponent=vi,d.IsometricEntitySystem=Wn,d.IsometricMap=zl,d.IsometricTile=qo,d.KeyEvent=wi,d.Keyboard=aa,d.Keys=oa,d.KillEvent=As,d.Label=Xl,d.LimitCameraBoundsStrategy=Jo,d.Line=gn,d.LineSegment=Q,d.Loader=Ki,d.LoaderEvents=Fl,d.LockCameraToActorAxisStrategy=Zo,d.LockCameraToActorStrategy=$o,d.LogLevel=Le,d.Logger=R,d.Material=Kr,d.Matrix=Ct,d.MatrixLocations=cr,d.MediaEvent=zn,d.Meet=Zi,d.MotionComponent=O,d.MotionSystem=ji,d.MoveBy=Tn,d.MoveByWithOptions=ro,d.MoveTo=An,d.MoveToWithOptions=ao,d.NativePointerButton=Pe,d.NativeSoundEvent=Ae,d.NativeSoundProcessedEvent=Lo,d.NineSlice=wn,d.NineSliceStretch=Ur,d.Node=Ti,d.None=rn,d.Observable=gt,d.OffscreenSystem=mn,d.Pair=pt,d.ParallaxComponent=Gi,d.ParallelActions=Zl,d.Particle=$i,d.ParticleEmitter=Yl,d.ParticleRenderer=Zr,d.ParticleTransform=Xt,d.PhysicsStats=rs,d.PhysicsWorld=Fo,d.PointerAbstraction=Xn,d.PointerButton=ce,d.PointerComponent=he,d.PointerEvent=xi,d.PointerEventReceiver=ns,d.PointerScope=Be,d.PointerSystem=es,d.PointerType=de,d.Polygon=vn,d.PolygonCollider=lt,d.Pool=zi,d.PositionNode=_r,d.PostCollisionEvent=we,d.PostDebugDrawEvent=Bs,d.PostDrawEvent=Ue,d.PostFrameEvent=Ls,d.PostKillEvent=Es,d.PostTransformDrawEvent=Fs,d.PostUpdateEvent=oe,d.PreCollisionEvent=ve,d.PreDebugDrawEvent=Ds,d.PreDrawEvent=ze,d.PreFrameEvent=ks,d.PreKillEvent=Ps,d.PreLoadEvent=Wl,d.PreTransformDrawEvent=Ms,d.PreUpdateEvent=re,d.Projection=ei,d.QuadIndexBuffer=Ze,d.QuadTree=Je,d.Query=Lt,d.QueryManager=Tr,d.RadiusAroundActorStrategy=Qo,d.Random=se,d.Raster=Ge,d.Ray=ge,d.RealisticSolver=Dn,d.Rectangle=ui,d.RemoveEvent=Js,d.RemovedComponent=Ah,d.RentalPool=qe,d.Repeat=io,d.RepeatForever=so,d.Resolution=Bn,d.Resource=li,d.ResourceEvents=Hh,d.RotateBy=uo,d.RotateByWithOptions=co,d.RotateTo=lo,d.RotateToWithOptions=ho,d.RotationType=j,d.ScaleBy=vo,d.ScaleByWithOptions=mo,d.ScaleTo=go,d.ScaleToWithOptions=fo,d.Scene=Mt,d.SceneEvents=Gl,d.Screen=kn,d.ScreenAppender=mr,d.ScreenElement=Hn,d.ScreenEvents=Pl,d.ScreenShader=jr,d.ScrollPreventionMode=Ke,d.Semaphore=xc,d.SeparatingAxis=Ne,d.SeparationInfo=Mr,d.Shader=Bt,d.Shape=ut,d.Slide=gc,d.SolverStrategy=Li,d.Sound=Un,d.SoundEvents=Rl,d.SoundManager=hc,d.SparseHashGrid=Rn,d.SparseHashGridCollisionProcessor=Mn,d.SpatialPartitionStrategy=hi,d.Sprite=Ut,d.SpriteFont=Oi,d.SpriteSheet=ye,d.StandardClock=jn,d.StateMachine=Ji,d.StrategyContainer=Xo,d.Stream=ba,d.System=Et,d.SystemManager=Pr,d.SystemPriority=Gt,d.SystemType=Pt,d.TagQuery=Ks,d.TestClock=_a,d.Text=_i,d.TextAlign=hn,d.TextureLoader=Xe,d.Tile=Vo,d.TileMap=Go,d.TileMapEvents=Ll,d.TiledAnimation=xn,d.TiledSprite=di,d.Timer=ts,d.Toaster=fa,d.Transform=Kt,d.TransformComponent=P,d.Transition=cs,d.TreeNode=tn,d.Trigger=ta,d.TriggerEvents=Ol,d.TwoPI=it,d.UniformBuffer=Nr,d.Util=pc,d.Vector=w,d.VectorView=ps,d.VertexBuffer=Ht,d.VertexLayout=Yt,d.VerticalFirst=sn,d.VisibleEvent=Ns,d.WebAudio=Bo,d.WebAudioInstance=ko,d.WheelDeltaMode=bi,d.WheelEvent=ha,d.World=Er,d.approximatelyEqual=ar,d.assert=Jn,d.canonicalizeAngle=Jt,d.clamp=B,d.coroutine=Ta,d.createId=fe,d.easeInBack=fh,d.easeInBounce=gr,d.easeInCirc=dh,d.easeInCubic=th,d.easeInElastic=mh,d.easeInExpo=hh,d.easeInOutBack=ph,d.easeInOutBounce=xh,d.easeInOutCirc=_h,d.easeInOutCubic=bs,d.easeInOutElastic=wh,d.easeInOutExpo=ch,d.easeInOutQuad=Ka,d.easeInOutQuart=nh,d.easeInOutQuint=ah,d.easeInOutSine=ja,d.easeInQuad=Qa,d.easeInQuart=ih,d.easeInQuint=rh,d.easeInSine=$a,d.easeOutBack=gh,d.easeOutBounce=ys,d.easeOutCirc=uh,d.easeOutCubic=eh,d.easeOutElastic=vh,d.easeOutExpo=lh,d.easeOutQuad=Ja,d.easeOutQuart=sh,d.easeOutQuint=oh,d.easeOutSine=Za,d.frac=Na,d.getDefaultPhysicsConfig=te,d.glTypeToUniformTypeName=Xr,d.hasGraphicsTick=Sn,d.hasOnAdd=nc,d.hasOnInitialize=Kl,d.hasOnPostUpdate=sc,d.hasOnPreUpdate=ec,d.hasOnRemove=rc,d.hasPostDraw=ac,d.hasPreDraw=oc,d.has_add=Ql,d.has_initialize=jl,d.has_postupdate=ic,d.has_preupdate=tc,d.has_remove=Jl,d.inverseLerp=dr,d.inverseLerpVector=ur,d.isActor=Tl,d.isAddedComponent=Th,d.isComponentCtor=vr,d.isLegacyEasing=Te,d.isLoaderConstructor=On,d.isMoveByOptions=no,d.isMoveToOptions=oo,d.isRemovedComponent=Ph,d.isRotateByOptions=Sl,d.isRotateToOptions=Cl,d.isScaleByOptions=po,d.isScaleToOptions=_o,d.isSceneConstructor=jt,d.isScreenElement=Ho,d.isSystemConstructor=Ar,d.lerp=ot,d.lerpAngle=ms,d.lerpVector=ii,d.linear=Ai,d.maxMessages=Aa,d.nextActionId=H,d.obsolete=vc,d.parseImageFiltering=Ve,d.parseImageWrapping=Ot,d.pixelSnapEpsilon=D,d.randomInRange=Nt,d.randomIntInRange=Va,d.range=Ga,d.remap=Wt,d.remapVector=qa,d.resetObsoleteCounter=mc,d.sign=V,d.smootherstep=Ya,d.smoothstep=Xa,d.toDegrees=hr,d.toRadians=Wa,d.vec=b,d.webgl=Yh,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
931
|
+
`,Function.prototype.toString.call(m)):(u=!0,x(c.clock.elapsed())),g),generator:p,done:v,then:v.then.bind(v),[Symbol.iterator]:()=>p};return g}class cs extends At{constructor(t){var e,i,s,n,o;super(),this._logger=R.getInstance(),this.transform=new P,this.graphics=new K,this._completeFuture=new wt,this.started=!1,this._currentDistance=0,this._currentProgress=0,this.done=this._completeFuture.promise,this._useLegacyEasing=!1,this.name=`Transition#${this.id}`,this.duration=t.duration,Te(t.easing)?(this.legacyEasing=(e=t.easing)!=null?e:Rt.Linear,this._useLegacyEasing=!0):this.easing=(i=t.easing)!=null?i:Ai,this.direction=(s=t.direction)!=null?s:"out",this.hideLoader=(n=t.hideLoader)!=null?n:!1,this.blockInput=(o=t.blockInput)!=null?o:!1,this.transform.coordPlane=rt.Screen,this.transform.pos=w.Zero,this.transform.z=1/0,this.graphics.anchor=w.Zero,this.addComponent(this.transform),this.addComponent(this.graphics),this.direction==="out"?this._currentProgress=0:this._currentProgress=1}get progress(){return this._currentProgress}get distance(){return this._currentDistance}get complete(){return this.direction==="out"?this.progress>=1:this.progress<=0}updateTransition(t,e){this.complete||(this._currentDistance+=B(e/this.duration,0,1),this._currentDistance>=1&&(this._currentDistance=1),this.direction==="out"?this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,0,1,1),0,1):this._currentProgress=B(ot(0,1,this.easing(this._currentDistance)),0,1):this._useLegacyEasing?this._currentProgress=B(this.legacyEasing(this._currentDistance,1,0,1),0,1):this._currentProgress=B(ot(1,0,this.easing(this._currentDistance)),0,1))}async onPreviousSceneDeactivate(t){}onStart(t){}onUpdate(t){}onEnd(t){}onReset(){}reset(){this.started=!1,this._completeFuture=new wt,this.done=this._completeFuture.promise,this._currentDistance=0,this.direction==="out"?this._currentProgress=0:this._currentProgress=1,this.onReset()}_addToTargetScene(t,e){const i=e;if(this.started&&this._logger.warn(`Attempted to add a transition ${this.name} that is already playing.`),i.world.entityManager.getById(this.id))return this._co;this._engine=t,i.add(this);const s=this;return this._co=Ta(t,function*(){for(;!s.complete;){const n=yield;s.updateTransition(s._engine,n),s._execute()}},{autostart:!1}),this._co}async _play(){this.started&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that is already playing, reset transition.`)),(!this._engine||!this._co)&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that hasn't been added`)),this._co&&await this._co.start()}_execute(){this.isInitialized&&(this.started||(this.started=!0,this.onStart(this.progress)),this.onUpdate(this.progress),this.complete&&!this._completeFuture.isCompleted&&(this.onEnd(this.progress),this._completeFuture.resolve()))}}class _c extends cs{constructor(t){var e,i;super({...t,duration:(e=t.duration)!=null?e:2e3}),this.name=`FadeInOut#${this.id}`,this.color=(i=t.color)!=null?i:T.Black}onInitialize(t){this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=new ui({width:t.screen.resolution.width,height:t.screen.resolution.height,color:this.color}),this.graphics.add(this.screenCover),this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=t}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class fc extends cs{constructor(t){super({direction:"in",...t}),this.name=`CrossFade#${this.id}`}async onPreviousSceneDeactivate(t){this.image=await t.engine.screenshot(!0),await this.image.decode()}onInitialize(t){this.engine=t,this.transform.pos=t.screen.unsafeArea.topLeft,this.screenCover=qt.fromHtmlImageElement(this.image).toSprite(),this.graphics.add(this.screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio),this.graphics.opacity=this.progress}onStart(t){this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onEnd(t){this.graphics.opacity=t}onUpdate(t){this.graphics.opacity=t}}class gc extends cs{constructor(t){var e;super({direction:"in",...t}),this._easing=Rt.Linear,this._start=w.Zero,this._end=w.Zero,this.name=`Slide#${this.id}`,this.slideDirection=t.slideDirection,this.transform.coordPlane=rt.Screen,this.graphics.forceOnScreen=!0,this._easing=(e=t.easingFunction)!=null?e:this._easing}async onPreviousSceneDeactivate(t){this._image=await t.engine.screenshot(!0),await this._image.decode(),this._screenCover=qt.fromHtmlImageElement(this._image).toSprite()}onInitialize(t){this._engine=t;let e=t.screen.unsafeArea;switch(e.hasZeroDimensions()&&(e=t.screen.contentArea),this.slideDirection){case"up":{this._directionOffset=b(0,-e.height);break}case"down":{this._directionOffset=b(0,e.height);break}case"left":{this._directionOffset=b(-e.width,0);break}case"right":{this._directionOffset=b(e.width,0);break}}this._camera=this._engine.currentScene.camera,this._destinationCameraPosition=this._camera.pos.clone(),this._camera.pos=this._camera.pos.add(this._directionOffset),this.transform.pos=this.transform.pos.add(this._directionOffset),this._startCameraPosition=this._camera.pos.clone(),this._start=e.topLeft,this._end=this._start.add(this._directionOffset),this.transform.pos=this._start,this.graphics.use(this._screenCover),this.transform.scale=b(1/t.screen.pixelRatio,1/t.screen.pixelRatio)}onStart(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}onUpdate(t){const e=this._easing(this.distance,0,1,1);this.transform.pos.x=ot(this._start.x,this._end.x,e),this.transform.pos.y=ot(this._start.y,this._end.y,e),this._camera.pos.x=ot(this._startCameraPosition.x,this._destinationCameraPosition.x,e),this._camera.pos.y=ot(this._startCameraPosition.y,this._destinationCameraPosition.y,e)}}const pc=Object.freeze(Object.defineProperty({__proto__:null,ConsoleAppender:Cs,DrawUtil:zh,EasingFunctions:Rt,LogLevel:Le,Logger:R,Observable:gt,ScreenAppender:mr,addItemToArray:Ch,contains:xr,delay:Fi,fail:br,getMinIndex:wr,getPosition:oi,isLegacyEasing:Te,isObject:Di,mergeDeep:Bi,omit:yr,removeItemFromArray:He},Symbol.toStringTag,{value:"Module"})),Aa=5,ti={},mc=()=>{for(const r in ti)ti[r]=0},ds=(r,t)=>{const e=De.isEnabled("suppress-obsolete-message");ti[r]<Aa&&!e&&(R.getInstance().warn(r),console.trace&&t.showStackTrace&&console.trace()),ti[r]++};function vc(r){return r={message:"This feature will be removed in future versions of Excalibur.",alternateMethod:null,showStackTrace:!1,...r},function(t,e,i){if(i&&!(typeof i.value=="function"||typeof i.get=="function"||typeof i.set=="function"))throw new SyntaxError("Only classes/functions/getters/setters can be marked as obsolete");const n=`${`${t.name||""}${t.name&&e?".":""}${e||""}`} is marked obsolete: ${r.message}`+(r.alternateMethod?` Use ${r.alternateMethod} instead`:"");ti[n]||(ti[n]=0);const o=i?{...i}:t;if(!i){class a extends o{constructor(...l){ds(n,r),super(...l)}}return a}return i&&i.value?(o.value=function(){return ds(n,r),i.value.apply(this,arguments)},o):(i&&i.get&&(o.get=function(){return ds(n,r),i.get.apply(this,arguments)}),i&&i.set&&(o.set=function(){return ds(n,r),i.set.apply(this,arguments)}),o)}}class wc{constructor(){this._queue=[]}get length(){return this._queue.length}enqueue(){const t=new wt;return this._queue.push(t),t.promise}dequeue(t){this._queue.shift().resolve(t)}}class xc{constructor(t){this._count=t,this._waitQueue=new wc}get count(){return this._count}get waiting(){return this._waitQueue.length}async enter(){return this._count!==0?(this._count--,Promise.resolve()):this._waitQueue.enqueue()}exit(t=1){if(t!==0){for(;t!==0&&this._waitQueue.length!==0;)this._waitQueue.dequeue(null),t--;this._count+=t}}}const er="0.32.0-alpha.1589+bc6ab76";Fe(),d.ActionCompleteEvent=js,d.ActionContext=fi,d.ActionQueue=eo,d.ActionSequence=Kn,d.ActionStartEvent=Zs,d.ActionsComponent=Qe,d.ActionsSystem=Vn,d.ActivateEvent=Gs,d.Actor=kt,d.ActorEvents=Al,d.AddEvent=Qs,d.AddedComponent=Sh,d.AffineMatrix=Z,d.Animation=Ui,d.AnimationDirection=Br,d.AnimationEvents=Dh,d.AnimationStrategy=kr,d.ArcadeSolver=Fn,d.AudioContextFactory=pi,d.Axes=ea,d.Axis=Yo,d.BaseAlign=ln,d.BezierCurve=si,d.Blink=yo,d.BodyComponent=N,d.BoundingBox=F,d.BrowserComponent=$n,d.BrowserEvents=da,d.Buttons=qn,d.Camera=Ko,d.CameraEvents=Ul,d.Canvas=Xi,d.ChannelCollection=xa,d.Circle=qi,d.CircleCollider=dt,d.Clock=Zn,d.ClosestLineJumpTable=Vt,d.Collider=ai,d.ColliderComponent=tt,d.CollisionContact=xe,d.CollisionEndEvent=ri,d.CollisionGroup=me,d.CollisionGroupManager=Pi,d.CollisionJumpTable=zt,d.CollisionPostSolveEvent=Mi,d.CollisionPreSolveEvent=Ri,d.CollisionStartEvent=ni,d.CollisionSystem=Qi,d.CollisionType=M,d.Color=T,d.ColorBlindFlags=la,d.ColorBlindnessMode=$e,d.ColorBlindnessPostProcessor=Qr,d.Component=Dt,d.CompositeCollider=at,d.ConsoleAppender=Cs,d.ContactConstraintPoint=Mo,d.ContactEndEvent=Ii,d.ContactSolveBias=ae,d.ContactStartEvent=Ei,d.CoordPlane=rt,d.CrossFade=fc,d.CurveBy=Eo,d.CurveTo=Po,d.DeactivateEvent=Vs,d.Debug=Tt,d.DebugConfig=ca,d.DebugGraphicsComponent=Wi,d.DebugSystem=Gn,d.DebugText=fn,d.DefaultAntialiasOptions=Or,d.DefaultGarbageCollectionOptions=Qn,d.DefaultLoader=mi,d.DefaultPixelArtOptions=Hr,d.DegreeOfFreedom=le,d.Delay=So,d.Detector=Oo,d.Die=To,d.Direction=dn,d.Director=pa,d.DirectorEvents=ga,d.DisplayMode=gi,d.DynamicTree=en,d.DynamicTreeCollisionProcessor=ki,d.EX_VERSION=er,d.EaseBy=bo,d.EaseTo=xo,d.EasingFunctions=Rt,d.Edge=ws,d.EdgeCollider=St,d.ElasticToActorStrategy=jo,d.EmitterType=Ee,d.Engine=as,d.EngineEvents=ql,d.EnterTriggerEvent=Ys,d.EnterViewPortEvent=Xs,d.Entity=At,d.EntityEvents=Eh,d.EntityManager=Sr,d.EventEmitter=X,d.EventTypes=Ts,d.Events=yh,d.ExResponse=Ln,d.ExcaliburGraphicsContext2DCanvas=Yi,d.ExcaliburGraphicsContextWebGL=$t,d.ExitTriggerEvent=$s,d.ExitViewPortEvent=qs,d.Fade=Co,d.FadeInOut=_c,d.Flags=De,d.Flash=Ao,d.Follow=Pn,d.Font=Se,d.FontCache=Vi,d.FontSource=dc,d.FontStyle=cn,d.FontUnit=an,d.FpsSampler=ua,d.FrameStats=yi,d.Future=wt,d.GameEvent=k,d.GameStartEvent=Is,d.GameStopEvent=Rs,d.Gamepad=ss,d.GamepadAxisEvent=Hs,d.GamepadButtonEvent=Os,d.GamepadConnectEvent=zs,d.GamepadDisconnectEvent=Us,d.Gamepads=is,d.GarbageCollector=wa,d.Gif=lc,d.GifParser=ya,d.GlobalCoordinates=ke,d.GpuParticleEmitter=$l,d.GpuParticleRenderer=hs,d.Graph=vs,d.Graphic=st,d.GraphicsComponent=K,d.GraphicsGroup=We,d.GraphicsSystem=pn,d.HashColliderProxy=Ro,d.HashGridCell=Zt,d.HashGridProxy=In,d.HiddenEvent=Ws,d.HorizontalFirst=nn,d.ImageFiltering=mt,d.ImageSource=qt,d.ImageSourceAttributeConstants=U,d.ImageWrapping=_t,d.InitializeEvent=Oe,d.InputHost=Yn,d.InputMapper=ia,d.IsometricEntityComponent=vi,d.IsometricEntitySystem=Wn,d.IsometricMap=zl,d.IsometricTile=qo,d.KeyEvent=wi,d.Keyboard=aa,d.Keys=oa,d.KillEvent=As,d.Label=Xl,d.LimitCameraBoundsStrategy=Jo,d.Line=gn,d.LineSegment=Q,d.Loader=Ki,d.LoaderEvents=Fl,d.LockCameraToActorAxisStrategy=Zo,d.LockCameraToActorStrategy=$o,d.LogLevel=Le,d.Logger=R,d.Material=Kr,d.Matrix=Ct,d.MatrixLocations=cr,d.MediaEvent=zn,d.Meet=Zi,d.MotionComponent=O,d.MotionSystem=ji,d.MoveBy=Tn,d.MoveByWithOptions=ro,d.MoveTo=An,d.MoveToWithOptions=ao,d.NativePointerButton=Pe,d.NativeSoundEvent=Ae,d.NativeSoundProcessedEvent=Lo,d.NineSlice=wn,d.NineSliceStretch=Ur,d.Node=Ti,d.None=rn,d.Observable=gt,d.OffscreenSystem=mn,d.Pair=pt,d.ParallaxComponent=Gi,d.ParallelActions=Zl,d.Particle=$i,d.ParticleEmitter=Yl,d.ParticleRenderer=Zr,d.ParticleTransform=Xt,d.PhysicsStats=rs,d.PhysicsWorld=Fo,d.PointerAbstraction=Xn,d.PointerButton=ce,d.PointerComponent=he,d.PointerEvent=xi,d.PointerEventReceiver=ns,d.PointerScope=Be,d.PointerSystem=es,d.PointerType=de,d.Polygon=vn,d.PolygonCollider=lt,d.Pool=zi,d.PositionNode=_r,d.PostCollisionEvent=we,d.PostDebugDrawEvent=Bs,d.PostDrawEvent=Ue,d.PostFrameEvent=Ls,d.PostKillEvent=Es,d.PostTransformDrawEvent=Fs,d.PostUpdateEvent=oe,d.PreCollisionEvent=ve,d.PreDebugDrawEvent=Ds,d.PreDrawEvent=ze,d.PreFrameEvent=ks,d.PreKillEvent=Ps,d.PreLoadEvent=Wl,d.PreTransformDrawEvent=Ms,d.PreUpdateEvent=re,d.Projection=ei,d.QuadIndexBuffer=Ze,d.QuadTree=Je,d.Query=Lt,d.QueryManager=Tr,d.RadiusAroundActorStrategy=Qo,d.Random=se,d.Raster=Ge,d.Ray=ge,d.RealisticSolver=Dn,d.Rectangle=ui,d.RemoveEvent=Js,d.RemovedComponent=Ah,d.RentalPool=qe,d.Repeat=io,d.RepeatForever=so,d.Resolution=Bn,d.Resource=li,d.ResourceEvents=Hh,d.RotateBy=uo,d.RotateByWithOptions=co,d.RotateTo=lo,d.RotateToWithOptions=ho,d.RotationType=j,d.ScaleBy=vo,d.ScaleByWithOptions=mo,d.ScaleTo=go,d.ScaleToWithOptions=fo,d.Scene=Mt,d.SceneEvents=Gl,d.Screen=kn,d.ScreenAppender=mr,d.ScreenElement=Hn,d.ScreenEvents=Pl,d.ScreenShader=jr,d.ScrollPreventionMode=Ke,d.Semaphore=xc,d.SeparatingAxis=Ne,d.SeparationInfo=Mr,d.Shader=Bt,d.Shape=ut,d.Slide=gc,d.SolverStrategy=Li,d.Sound=Un,d.SoundEvents=Rl,d.SoundManager=hc,d.SparseHashGrid=Rn,d.SparseHashGridCollisionProcessor=Mn,d.SpatialPartitionStrategy=hi,d.Sprite=Ut,d.SpriteFont=Oi,d.SpriteSheet=ye,d.StandardClock=jn,d.StateMachine=Ji,d.StrategyContainer=Xo,d.Stream=ba,d.System=Et,d.SystemManager=Pr,d.SystemPriority=Gt,d.SystemType=Pt,d.TagQuery=Ks,d.TestClock=_a,d.Text=_i,d.TextAlign=hn,d.TextureLoader=Xe,d.Tile=Vo,d.TileMap=Go,d.TileMapEvents=Ll,d.TiledAnimation=xn,d.TiledSprite=di,d.Timer=ts,d.Toaster=fa,d.Transform=Kt,d.TransformComponent=P,d.Transition=cs,d.TreeNode=tn,d.Trigger=ta,d.TriggerEvents=Ol,d.TwoPI=it,d.UniformBuffer=Nr,d.Util=pc,d.Vector=w,d.VectorView=ps,d.VertexBuffer=Ht,d.VertexLayout=Yt,d.VerticalFirst=sn,d.VisibleEvent=Ns,d.WebAudio=Bo,d.WebAudioInstance=ko,d.WheelDeltaMode=bi,d.WheelEvent=ha,d.World=Er,d.approximatelyEqual=ar,d.assert=Jn,d.canonicalizeAngle=Jt,d.clamp=B,d.coroutine=Ta,d.createId=fe,d.easeInBack=fh,d.easeInBounce=gr,d.easeInCirc=dh,d.easeInCubic=th,d.easeInElastic=mh,d.easeInExpo=hh,d.easeInOutBack=ph,d.easeInOutBounce=xh,d.easeInOutCirc=_h,d.easeInOutCubic=bs,d.easeInOutElastic=wh,d.easeInOutExpo=ch,d.easeInOutQuad=Ka,d.easeInOutQuart=nh,d.easeInOutQuint=ah,d.easeInOutSine=ja,d.easeInQuad=Qa,d.easeInQuart=ih,d.easeInQuint=rh,d.easeInSine=$a,d.easeOutBack=gh,d.easeOutBounce=ys,d.easeOutCirc=uh,d.easeOutCubic=eh,d.easeOutElastic=vh,d.easeOutExpo=lh,d.easeOutQuad=Ja,d.easeOutQuart=sh,d.easeOutQuint=oh,d.easeOutSine=Za,d.frac=Na,d.getDefaultPhysicsConfig=te,d.glTypeToUniformTypeName=Xr,d.hasGraphicsTick=Sn,d.hasOnAdd=nc,d.hasOnInitialize=Kl,d.hasOnPostUpdate=sc,d.hasOnPreUpdate=ec,d.hasOnRemove=rc,d.hasPostDraw=ac,d.hasPreDraw=oc,d.has_add=Ql,d.has_initialize=jl,d.has_postupdate=ic,d.has_preupdate=tc,d.has_remove=Jl,d.inverseLerp=dr,d.inverseLerpVector=ur,d.isActor=Tl,d.isAddedComponent=Th,d.isComponentCtor=vr,d.isLegacyEasing=Te,d.isLoaderConstructor=On,d.isMoveByOptions=no,d.isMoveToOptions=oo,d.isRemovedComponent=Ph,d.isRotateByOptions=Sl,d.isRotateToOptions=Cl,d.isScaleByOptions=po,d.isScaleToOptions=_o,d.isSceneConstructor=jt,d.isScreenElement=Ho,d.isSystemConstructor=Ar,d.lerp=ot,d.lerpAngle=ms,d.lerpVector=ii,d.linear=Ai,d.maxMessages=Aa,d.nextActionId=H,d.obsolete=vc,d.parseImageFiltering=Ve,d.parseImageWrapping=Ot,d.pixelSnapEpsilon=D,d.randomInRange=Nt,d.randomIntInRange=Va,d.range=Ga,d.remap=Wt,d.remapVector=qa,d.resetObsoleteCounter=mc,d.sign=V,d.smootherstep=Ya,d.smoothstep=Xa,d.toDegrees=hr,d.toRadians=Wa,d.vec=b,d.webgl=Yh,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -33462,7 +33462,7 @@ class Semaphore {
|
|
|
33462
33462
|
this._count += count;
|
|
33463
33463
|
}
|
|
33464
33464
|
}
|
|
33465
|
-
const EX_VERSION = "0.32.0-alpha.
|
|
33465
|
+
const EX_VERSION = "0.32.0-alpha.1589+bc6ab76";
|
|
33466
33466
|
polyfill();
|
|
33467
33467
|
export {
|
|
33468
33468
|
ActionCompleteEvent,
|
package/build/esm/excalibur.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -33462,7 +33462,7 @@ class Semaphore {
|
|
|
33462
33462
|
this._count += count;
|
|
33463
33463
|
}
|
|
33464
33464
|
}
|
|
33465
|
-
const EX_VERSION = "0.32.0-alpha.
|
|
33465
|
+
const EX_VERSION = "0.32.0-alpha.1589+bc6ab76";
|
|
33466
33466
|
polyfill();
|
|
33467
33467
|
export {
|
|
33468
33468
|
ActionCompleteEvent,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -22488,7 +22488,7 @@ class Cc {
|
|
|
22488
22488
|
}
|
|
22489
22489
|
}
|
|
22490
22490
|
}
|
|
22491
|
-
const an = "0.32.0-alpha.
|
|
22491
|
+
const an = "0.32.0-alpha.1589+bc6ab76";
|
|
22492
22492
|
hn();
|
|
22493
22493
|
export {
|
|
22494
22494
|
Wn as ActionCompleteEvent,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! excalibur - 0.32.0-alpha.
|
|
1
|
+
/*! excalibur - 0.32.0-alpha.1589+bc6ab76 - 2025-12-2
|
|
2
2
|
https://github.com/excaliburjs/Excalibur
|
|
3
3
|
Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
|
|
4
4
|
Licensed BSD-2-Clause
|
|
@@ -22488,7 +22488,7 @@ class Cc {
|
|
|
22488
22488
|
}
|
|
22489
22489
|
}
|
|
22490
22490
|
}
|
|
22491
|
-
const an = "0.32.0-alpha.
|
|
22491
|
+
const an = "0.32.0-alpha.1589+bc6ab76";
|
|
22492
22492
|
hn();
|
|
22493
22493
|
export {
|
|
22494
22494
|
Wn as ActionCompleteEvent,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "excalibur",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.32.0-alpha.
|
|
4
|
+
"version": "0.32.0-alpha.1589",
|
|
5
5
|
"exNextVersion": "0.32.0",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"provenance": true
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"vite-plugin-banner": "0.8.1",
|
|
138
138
|
"vite-plugin-static-copy": "3.1.4",
|
|
139
139
|
"vitest": "3.2.4",
|
|
140
|
-
"webpack": "5.
|
|
140
|
+
"webpack": "5.103.0",
|
|
141
141
|
"webpack-cli": "5.1.4"
|
|
142
142
|
},
|
|
143
143
|
"lint-staged": {
|
package/vitest.config.ts
CHANGED
|
@@ -28,7 +28,7 @@ export default defineConfig(
|
|
|
28
28
|
reporter: [['html'], ['lcov', { projectRoot: __dirname }], ['text-summary']],
|
|
29
29
|
reportsDirectory: path.join(__dirname, 'coverage')
|
|
30
30
|
},
|
|
31
|
-
projects: ['./src/spec/vitest.config.unit.ts', './src/spec/vitest.config.visual.ts']
|
|
31
|
+
projects: [path.resolve(__dirname, './src/spec/vitest.config.unit.ts'), path.resolve(__dirname, './src/spec/vitest.config.visual.ts')]
|
|
32
32
|
}
|
|
33
33
|
} satisfies ViteUserConfig)
|
|
34
34
|
);
|