zshashz commited on
Commit
f563b68
·
1 Parent(s): ba53d23
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. AsyncTasksManager.js +5 -0
  3. CustomRuntimeObject.js +2 -0
  4. CustomRuntimeObject2D.js +2 -0
  5. CustomRuntimeObjectInstanceContainer.js +2 -0
  6. Extensions/TextObject/textruntimeobject-pixi-renderer.js +2 -0
  7. Extensions/TextObject/textruntimeobject.js +2 -0
  8. LICENSE.GDevelop.txt +2 -0
  9. Model3DManager.js +2 -0
  10. ResourceCache.js +2 -0
  11. ResourceLoader.js +2 -0
  12. RuntimeCustomObjectLayer.js +2 -0
  13. RuntimeInstanceContainer.js +2 -0
  14. RuntimeLayer.js +2 -0
  15. SpriteAnimator.js +2 -0
  16. Start button.png +0 -0
  17. affinetransformation.js +2 -0
  18. code0.js +110 -0
  19. data.js +2 -0
  20. events-tools/cameratools.js +2 -0
  21. events-tools/commontools.js +2 -0
  22. events-tools/inputtools.js +2 -0
  23. events-tools/networktools.js +2 -0
  24. events-tools/objecttools.js +2 -0
  25. events-tools/runtimescenetools.js +2 -0
  26. events-tools/soundtools.js +2 -0
  27. events-tools/storagetools.js +2 -0
  28. events-tools/stringtools.js +3 -0
  29. events-tools/variabletools.js +2 -0
  30. events-tools/windowtools.js +2 -0
  31. fontfaceobserver-font-manager/fontfaceobserver-font-manager.js +2 -0
  32. fontfaceobserver-font-manager/fontfaceobserver.js +16 -0
  33. force.js +2 -0
  34. gd.js +2 -0
  35. gdjs-evtsext__voicerecognition__onerror-func.js +97 -0
  36. gdjs-evtsext__voicerecognition__onfirstsceneloaded-func.js +183 -0
  37. gdjs-evtsext__voicerecognition__onsuccess-func.js +97 -0
  38. gdjs-evtsext__voicerecognition__retrieveerror-func.js +107 -0
  39. gdjs-evtsext__voicerecognition__retrievestatus-func.js +107 -0
  40. gdjs-evtsext__voicerecognition__retrievetresulttext-func.js +107 -0
  41. gdjs-evtsext__voicerecognition__startlistening-func.js +104 -0
  42. howler-sound-manager/howler-sound-manager.js +2 -0
  43. howler-sound-manager/howler.min.js +3 -0
  44. index.html +133 -17
  45. inputmanager.js +2 -0
  46. jsonmanager.js +2 -0
  47. layer.js +2 -0
  48. libs/jshashtable.js +2 -0
  49. libs/rbush.js +624 -0
  50. logger.js +2 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.glb filter=lfs diff=lfs merge=lfs -text
AsyncTasksManager.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ var gdjs;(function(i){class l{constructor(){this.tasksWithCallback=new Array}processTasks(e){for(let s=0;s<this.tasksWithCallback.length;s++){const r=this.tasksWithCallback[s];r.asyncTask.update(e)&&(r.callback(e),this.tasksWithCallback.splice(s--,1))}}addTask(e,s){this.tasksWithCallback.push({asyncTask:e,callback:s})}clearTasks(){this.tasksWithCallback.length=0}}i.AsyncTasksManager=l;class t{}i.AsyncTask=t;class o extends t{constructor(){super(...arguments);this.tasks=new Array}addTask(e){this.tasks.push(e)}update(e){for(let s=0;s<this.tasks.length;s++)this.tasks[s].update(e)&&this.tasks.splice(s--,1);return this.tasks.length===0}}i.TaskGroup=o;class c extends t{update(){return!0}}i.ResolveTask=c;const n=new i.Logger("Internal PromiseTask");class h extends t{constructor(e){super();this.isResolved=!1;this.promise=e.catch(s=>{n.error(`A promise error has not been handled, this should never happen!
2
+ If you are using JavaScript promises in an asynchronous action, make sure to add a .catch().
3
+ Otherwise, report this as a bug on the GDevelop forums!
4
+ ${s?"The following error was thrown: "+s:""}`)}).then(s=>(this.isResolved=!0,s))}update(){return this.isResolved}}i.PromiseTask=h;class k extends t{constructor(){super(...arguments);this.isResolved=!1}resolve(){this.isResolved=!0}update(){return this.isResolved}}i.ManuallyResolvableTask=k})(gdjs||(gdjs={}));
5
+ //# sourceMappingURL=AsyncTasksManager.js.map
CustomRuntimeObject.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(r){const o=new r.Logger("CustomRuntimeObject");class h extends r.RuntimeObject{constructor(t,e){super(t,e);this._isUntransformedHitBoxesDirty=!0;this._untransformedHitBoxes=[];this._unrotatedAABB={min:[0,0],max:[0,0]};this._innerArea=null;this._isInnerAreaFollowingParentSize=!1;this._scaleX=1;this._scaleY=1;this._flippedX=!1;this._flippedY=!1;this.opacity=255;this._customCenter=null;this._localTransformation=new r.AffineTransformation;this._localInverseTransformation=new r.AffineTransformation;this._isLocalTransformationDirty=!0;this._type=e.type,this._instanceContainer=new r.CustomRuntimeObjectInstanceContainer(t,this),this._renderer=this._createRender(),this._initializeFromObjectData(e)}_initializeFromObjectData(t){const e=this._runtimeScene.getGame().getEventsBasedObjectData(t.type);if(!e){o.error(`A CustomRuntimeObject was initialized (or re-initialized) from object data referring to an non existing events based object data with type "${t.type}".`);return}this._isInnerAreaFollowingParentSize=e.isInnerAreaFollowingParentSize,e.instances.length>0&&(this._innerArea||(this._innerArea={min:[0,0,0],max:[0,0,0]}),this._innerArea.min[0]=e.areaMinX,this._innerArea.min[1]=e.areaMinY,this._innerArea.min[2]=e.areaMinZ,this._innerArea.max[0]=e.areaMaxX,this._innerArea.max[1]=e.areaMaxY,this._innerArea.max[2]=e.areaMaxZ),this._instanceContainer.loadFrom(t,e)}reinitialize(t){super.reinitialize(t),this._initializeFromObjectData(t),this._reinitializeRenderer(),this.onCreated()}updateFromObjectData(t,e){const i=this.getAnimator();return i&&i.updateFromObjectData(t.animatable||[],e.animatable||[]),!0}extraInitializationFromInitialInstance(t){const e=this.getAnimator();if(t.numberProperties)for(let i=0,n=t.numberProperties.length;i<n;++i){const s=t.numberProperties[i];e&&s.name==="animation"&&e.setAnimationIndex(s.value)}t.customSize&&(this.setWidth(t.width),this.setHeight(t.height)),t.opacity!==void 0&&this.setOpacity(t.opacity),t.flippedX&&this.flipX(t.flippedX),t.flippedY&&this.flipY(t.flippedY)}onDeletedFromScene(t){this.onDestroy(t),super.onDeletedFromScene(t),this._instanceContainer.onDestroyFromScene(t)}update(t){this._instanceContainer._updateObjectsPreEvents(),this.doStepPreEvents(this._instanceContainer);const e=this.getRuntimeScene().getProfiler();e&&e.begin(this.type),this.doStepPostEvents(this._instanceContainer),e&&e.end(this.type),this._instanceContainer._updateObjectsPostEvents()}onHotReloading(t){}doStepPreEvents(t){}doStepPostEvents(t){}onDestroy(t){}updatePreRender(t){this._instanceContainer._updateObjectsPreRender(),this.getRenderer().ensureUpToDate()}getRenderer(){return this._renderer}getChildrenContainer(){return this._instanceContainer}onChildrenLocationChanged(){this._isUntransformedHitBoxesDirty=!0,this.invalidateHitboxes(),this.getRenderer().update()}updateHitBoxes(){this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes();const t=this.getLocalTransformation();for(let e=0;e<this._untransformedHitBoxes.length;++e){e>=this.hitBoxes.length&&this.hitBoxes.push(new r.Polygon);for(let i=0;i<this._untransformedHitBoxes[e].vertices.length;++i)i>=this.hitBoxes[e].vertices.length&&this.hitBoxes[e].vertices.push([0,0]),t.transform(this._untransformedHitBoxes[e].vertices[i],this.hitBoxes[e].vertices[i]);this.hitBoxes[e].vertices.length=this._untransformedHitBoxes[e].vertices.length}}_updateUntransformedHitBoxes(){this._isUntransformedHitBoxesDirty=!1,this._untransformedHitBoxes.length=0;let t=Number.MAX_VALUE,e=Number.MAX_VALUE,i=-Number.MAX_VALUE,n=-Number.MAX_VALUE;for(const s of this._instanceContainer.getAdhocListOfAllInstances()){if(!s.isIncludedInParentCollisionMask())continue;Array.prototype.push.apply(this._untransformedHitBoxes,s.getHitBoxes());const a=s.getAABB();t=Math.min(t,a.min[0]),e=Math.min(e,a.min[1]),i=Math.max(i,a.max[0]),n=Math.max(n,a.max[1])}for(t===Number.MAX_VALUE&&(t=0,e=0,i=1,n=1),this._unrotatedAABB.min[0]=t,this._unrotatedAABB.min[1]=e,this._unrotatedAABB.max[0]=i,this._unrotatedAABB.max[1]=n;this.hitBoxes.length<this._untransformedHitBoxes.length;)this.hitBoxes.push(new r.Polygon);this.hitBoxes.length=this._untransformedHitBoxes.length}applyObjectTransformation(t,e,i){const n=i;n[0]=t,n[1]=e,this.getLocalTransformation().transform(n,i)}getLocalTransformation(){return this._isLocalTransformationDirty&&this._updateLocalTransformation(),this._localTransformation}getLocalInverseTransformation(){return this._isLocalTransformationDirty&&this._updateLocalTransformation(),this._localInverseTransformation}_updateLocalTransformation(){const t=Math.abs(this._scaleX),e=Math.abs(this._scaleY),i=this.getUnscaledCenterX()*t,n=this.getUnscaledCenterY()*e,s=this.angle*Math.PI/180;this._localTransformation.setToTranslation(this.x,this.y),this._localTransformation.rotateAround(s,i,n),this._flippedX&&this._localTransformation.flipX(i),this._flippedY&&this._localTransformation.flipY(n),this._localTransformation.scale(t,e),this._localInverseTransformation.copyFrom(this._localTransformation),this._localInverseTransformation.invert(),this._isLocalTransformationDirty=!1}applyObjectInverseTransformation(t,e,i){const n=i;n[0]=t,n[1]=e,this.getLocalInverseTransformation().transform(n,i)}getDrawableX(){let t=0;this._innerArea?t=this._innerArea.min[0]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),t=this._unrotatedAABB.min[0]);const e=this.getScaleX();return this._flippedX?this.x+(-t-this.getUnscaledWidth()+2*this.getUnscaledCenterX())*e:this.x+t*e}getDrawableY(){let t=0;this._innerArea?t=this._innerArea.min[1]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),t=this._unrotatedAABB.min[1]);const e=this.getScaleY();return this._flippedY?this.y+(-t-this.getUnscaledHeight()+2*this.getUnscaledCenterY())*e:this.y+t*e}getInnerAreaMinX(){return this._innerArea?this._innerArea.min[0]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._unrotatedAABB.min[0])}getInnerAreaMinY(){return this._innerArea?this._innerArea.min[1]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._unrotatedAABB.min[1])}getInnerAreaMaxX(){return this._innerArea?this._innerArea.max[0]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._unrotatedAABB.max[0])}getInnerAreaMaxY(){return this._innerArea?this._innerArea.max[1]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._unrotatedAABB.max[1])}getUnscaledWidth(){return this._innerArea?this._innerArea.max[0]-this._innerArea.min[0]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._unrotatedAABB.max[0]-this._unrotatedAABB.min[0])}getUnscaledHeight(){return this._innerArea?this._innerArea.max[1]-this._innerArea.min[1]:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),this._unrotatedAABB.max[1]-this._unrotatedAABB.min[1])}getUnscaledCenterX(){return this._customCenter?this._customCenter[0]:this._innerArea?(this._innerArea.min[0]+this._innerArea.max[0])/2:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),(this._unrotatedAABB.min[0]+this._unrotatedAABB.max[0])/2)}getUnscaledCenterY(){return this._customCenter?this._customCenter[1]:this._innerArea?(this._innerArea.min[1]+this._innerArea.max[1])/2:(this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes(),(this._unrotatedAABB.min[1]+this._unrotatedAABB.max[1])/2)}setRotationCenter(t,e){this._customCenter||(this._customCenter=[0,0]),this._customCenter[0]=t,this._customCenter[1]=e,this._isLocalTransformationDirty=!0,this.invalidateHitboxes()}hasCustomRotationCenter(){return!!this._customCenter}getCenterX(){return(this.getUnscaledCenterX()-this._unrotatedAABB.min[0])*this.getScaleX()}getCenterY(){return(this.getUnscaledCenterY()-this._unrotatedAABB.min[1])*this.getScaleY()}getWidth(){return this.getUnscaledWidth()*this.getScaleX()}getHeight(){return this.getUnscaledHeight()*this.getScaleY()}setWidth(t){const e=this.getUnscaledWidth();if(e===0)return;const i=t/e;this._innerArea&&this._isInnerAreaFollowingParentSize?(this._innerArea.min[0]*=i,this._innerArea.max[0]*=i):this.setScaleX(i)}setHeight(t){const e=this.getUnscaledHeight();if(e===0)return;const i=t/e;this._innerArea&&this._isInnerAreaFollowingParentSize?(this._innerArea.min[1]*=i,this._innerArea.max[1]*=i):this.setScaleY(i)}setSize(t,e){this.setWidth(t),this.setHeight(e)}setX(t){t!==this.x&&(this.x=t,this._isLocalTransformationDirty=!0,this.invalidateHitboxes(),this.getRenderer().updateX())}setY(t){t!==this.y&&(this.y=t,this._isLocalTransformationDirty=!0,this.invalidateHitboxes(),this.getRenderer().updateY())}setAngle(t){this.angle!==t&&(this.angle=t,this._isLocalTransformationDirty=!0,this.invalidateHitboxes(),this.getRenderer().updateAngle())}setScale(t){this._innerArea&&this._isInnerAreaFollowingParentSize||(t<0&&(t=0),!(t===Math.abs(this._scaleX)&&t===Math.abs(this._scaleY))&&(this._scaleX=t*(this._flippedX?-1:1),this._scaleY=t*(this._flippedY?-1:1),this._isLocalTransformationDirty=!0,this.invalidateHitboxes(),this.getRenderer().update()))}setScaleX(t){this._innerArea&&this._isInnerAreaFollowingParentSize||(t<0&&(t=0),t!==Math.abs(this._scaleX)&&(this._scaleX=t*(this._flippedX?-1:1),this._isLocalTransformationDirty=!0,this.invalidateHitboxes(),this.getRenderer().update()))}setScaleY(t){this._innerArea&&this._isInnerAreaFollowingParentSize||(t<0&&(t=0),t!==Math.abs(this._scaleY)&&(this._scaleY=t*(this._flippedY?-1:1),this.invalidateHitboxes(),this.getRenderer().update()))}getScaleMean(){return(Math.abs(this._scaleX)+Math.abs(this._scaleY))/2}getScale(){const t=Math.abs(this._scaleX),e=Math.abs(this._scaleY);return t===e?t:Math.sqrt(t*e)}getScaleY(){return Math.abs(this._scaleY)}getScaleX(){return Math.abs(this._scaleX)}setOpacity(t){t<0&&(t=0),t>255&&(t=255),this.opacity=t,this.getRenderer().updateOpacity()}getOpacity(){return this.opacity}hide(t){t===void 0&&(t=!0),this.hidden=t,this.getRenderer().updateVisibility()}flipX(t){t!==this._flippedX&&(this._scaleX*=-1,this._flippedX=t,this.invalidateHitboxes(),this.getRenderer().update())}flipY(t){t!==this._flippedY&&(this._scaleY*=-1,this._flippedY=t,this.invalidateHitboxes(),this.getRenderer().update())}isFlippedX(){return this._flippedX}isFlippedY(){return this._flippedY}getAnimator(){return null}}r.CustomRuntimeObject=h,h.supportsReinitialization=!1})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=CustomRuntimeObject.js.map
CustomRuntimeObject2D.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(t){class n extends t.CustomRuntimeObject{constructor(e,r){super(e,r);this.getRenderer().reinitialize(this,e)}_createRender(){const e=this._runtimeScene;return new t.CustomRuntimeObject2DRenderer(this,this._instanceContainer,e)}_reinitializeRenderer(){this.getRenderer().reinitialize(this,this.getParent())}getRenderer(){return super.getRenderer()}getRendererObject(){return this.getRenderer().getRendererObject()}}t.CustomRuntimeObject2D=n})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=CustomRuntimeObject2D.js.map
CustomRuntimeObjectInstanceContainer.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(s){class l extends s.RuntimeInstanceContainer{constructor(t,n){super();this._isLoaded=!1;this._initialInnerArea=null;this._parent=t,this._customObject=n,this._runtimeScene=t.getScene(),this._debuggerRenderer=new s.DebuggerRenderer(this)}addLayer(t){const n=new s.RuntimeCustomObjectLayer(t,this);this._layers.put(t.name,n),this._orderedLayers.push(n)}createObject(t){const n=super.createObject(t);return this._customObject.onChildrenLocationChanged(),n}loadFrom(t,n){this._isLoaded&&this.onDestroyFromScene(this._parent),this._setOriginalInnerArea(n);for(let r=0,e=n.objects.length;r<e;++r){const i=n.objects[r];t.childrenContent?this.registerObject({...i,...t.childrenContent[i.name]}):this.registerObject(i)}if(n.layers.length>0)for(let r=0,e=n.layers.length;r<e;++r)this.addLayer(n.layers[r]);else this.addLayer({name:"",visibility:!0,cameras:[{defaultSize:!0,defaultViewport:!0,height:0,viewportBottom:0,viewportLeft:0,viewportRight:0,viewportTop:0,width:0}],effects:[],ambientLightColorR:0,ambientLightColorG:0,ambientLightColorB:0,isLightingLayer:!1,followBaseLayerCamera:!1});this.createObjectsFrom(n.instances,0,0,0,!0),this._setLayerDefaultZOrders(),this._isLoaded=!0}_setOriginalInnerArea(t){t.instances.length>0&&(t._initialInnerArea||(t._initialInnerArea={min:[t.areaMinX,t.areaMinY,t.areaMinZ],max:[t.areaMaxX,t.areaMaxY,t.areaMaxZ]}),this._initialInnerArea=t._initialInnerArea)}onDestroyFromScene(t){if(!this._isLoaded)return;const n=this.getAdhocListOfAllInstances();for(let r=0,e=n.length;r<e;++r){const i=n[r];i.onDeletedFromScene(this),i.onDestroyed()}this._destroy(),this._isLoaded=!1}_destroy(){super._destroy(),this._onceTriggers=null}_updateObjectsPreRender(){const t=this.getAdhocListOfAllInstances();for(let n=0,r=t.length;n<r;++n){const e=t[n],i=e.getRendererObject();i&&(i.visible=!e.isHidden(),i.visible&&this.getGame().getEffectsManager().updatePreRender(e.getRendererEffects(),e)),this._debugDrawEnabled&&this._debuggerRenderer.renderDebugDraw(t,this._debugDrawShowHiddenInstances,this._debugDrawShowPointsNames,this._debugDrawShowCustomPoints),e.updatePreRender(this)}}_updateObjectsPreEvents(){const t=this.getAdhocListOfAllInstances();for(let n=0,r=t.length;n<r;++n){const e=t[n],i=e.getElapsedTime();if(e.hasNoForces())e.update(this);else{const a=e.getAverageForce(),o=i/1e3;e.setX(e.getX()+a.getX()*o),e.setY(e.getY()+a.getY()*o),e.update(this),e.updateForces(o)}e.updateTimers(i),e.stepBehaviorsPreEvents(this)}this._cacheOrClearRemovedInstances()}getRenderer(){return this._customObject.getRenderer()}getDebuggerRenderer(){return this._debuggerRenderer}getGame(){return this._runtimeScene.getGame()}getScene(){return this._runtimeScene}getOwner(){return this._customObject}getAsyncTasksManager(){return this._runtimeScene.getAsyncTasksManager()}getUnrotatedViewportMinX(){return this._customObject.getInnerAreaMinX()}getUnrotatedViewportMinY(){return this._customObject.getInnerAreaMinY()}getUnrotatedViewportMaxX(){return this._customObject.getInnerAreaMaxX()}getUnrotatedViewportMaxY(){return this._customObject.getInnerAreaMaxY()}getInitialUnrotatedViewportMinX(){return this._initialInnerArea?this._initialInnerArea.min[0]:0}getInitialUnrotatedViewportMinY(){return this._initialInnerArea?this._initialInnerArea.min[1]:0}getInitialUnrotatedViewportMaxX(){return this._initialInnerArea?this._initialInnerArea.max[0]:0}getInitialUnrotatedViewportMaxY(){return this._initialInnerArea?this._initialInnerArea.max[1]:0}getViewportWidth(){return this._customObject.getUnscaledWidth()}getViewportHeight(){return this._customObject.getUnscaledHeight()}getViewportOriginX(){return this._customObject.getUnscaledCenterX()}getViewportOriginY(){return this._customObject.getUnscaledCenterY()}onChildrenLocationChanged(){this._customObject.onChildrenLocationChanged()}convertCoords(t,n,r){let e=r||[0,0];return e=this._parent.getLayer(this._customObject.getLayer()).convertCoords(t,n,0,e),this._customObject.applyObjectInverseTransformation(e[0],e[1],e),e}convertInverseCoords(t,n,r){const e=r||[0,0];return this._customObject.applyObjectTransformation(t,n,e),this._parent.convertInverseCoords(e[0],e[1],e)}getElapsedTime(){return this._parent.getElapsedTime()}}s.CustomRuntimeObjectInstanceContainer=l})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=CustomRuntimeObjectInstanceContainer.js.map
Extensions/TextObject/textruntimeobject-pixi-renderer.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(i){class s{constructor(e,t){this._justCreated=!0;this._object=e,this._fontManager=t.getGame().getFontManager(),this._text=new PIXI.Text(" ",{align:"left"}),this._text.anchor.x=.5,this._text.anchor.y=.5,t.getLayer("").getRenderer().addRendererObject(this._text,e.getZOrder()),this._text.text=e._str.length===0?" ":e._str,this.updateStyle(),this.updatePosition()}getRendererObject(){return this._text}ensureUpToDate(){this._justCreated&&(this._text.updateText(!1),this.updatePosition(),this._justCreated=!1)}updateStyle(){const e='"'+this._fontManager.getFontFamily(this._object._fontName)+'"',t=this._text.style;t.fontStyle=this._object._italic?"italic":"normal",t.fontWeight=this._object._bold?"bold":"normal",t.fontSize=this._object._characterSize,t.fontFamily=e,this._object._useGradient?t.fill=this._getGradientHex():t.fill=this._getColorHex(),this._object._gradientType==="LINEAR_VERTICAL"?t.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL:t.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_HORIZONTAL,t.align=this._object._textAlign,t.wordWrap=this._object._wrapping,t.wordWrapWidth=this._object._wrappingWidth,t.breakWords=!0,t.stroke=i.rgbToHexNumber(this._object._outlineColor[0],this._object._outlineColor[1],this._object._outlineColor[2]),t.strokeThickness=this._object._isOutlineEnabled?this._object._outlineThickness:0,t.dropShadow=this._object._shadow,t.dropShadowColor=i.rgbToHexNumber(this._object._shadowColor[0],this._object._shadowColor[1],this._object._shadowColor[2]),t.dropShadowAlpha=this._object._shadowOpacity/255,t.dropShadowBlur=this._object._shadowBlur,t.dropShadowAngle=i.toRad(this._object._shadowAngle),t.dropShadowDistance=this._object._shadowDistance;const o=t.dropShadow?t.dropShadowDistance+t.dropShadowBlur:0;t.padding=Math.ceil(this._object._padding+o),t.miterLimit=3,this.updatePosition(),this._text.dirty=!0}updatePosition(){if(this._object.isWrapping()){const t=this._object._textAlign==="right"?1:this._object._textAlign==="center"?.5:0,o=this._object.getWrappingWidth(),h=(o-this._text.width)*(t-.5);this._text.position.x=this._object.x+o/2,this._text.anchor.x=.5-h/this._text.width}else this._text.position.x=this._object.x+this._text.width/2,this._text.anchor.x=.5;this._text.position.y=this._object.y+this._text.height/2;const e=this._object._verticalTextAlignment==="bottom"?1:this._object._verticalTextAlignment==="center"?.5:0;this._text.position.y=this._object.y+this._text.height*(.5-e),this._text.anchor.y=.5}updateAngle(){this._text.rotation=i.toRad(this._object.angle)}updateOpacity(){this._text.alpha=this._object.opacity/255}updateString(){this._text.text=this._object._str.length===0?" ":this._object._str,this._text.updateText(!1)}getWidth(){return this._text.width}getHeight(){return this._text.height}_getColorHex(){return i.rgbToHexNumber(this._object._color[0],this._object._color[1],this._object._color[2])}_getGradientHex(){const e=[];for(let t=0;t<this._object._gradient.length;t++)e.push("#"+i.rgbToHex(this._object._gradient[t][0],this._object._gradient[t][1],this._object._gradient[t][2]));return e}getScaleX(){return this._text.scale.x}getScaleY(){return this._text.scale.y}setScale(e){this._text.scale.x=e,this._text.scale.y=e}setScaleX(e){this._text.scale.x=e}setScaleY(e){this._text.scale.y=e}destroy(){this._text.destroy(!0)}}i.TextRuntimeObjectRenderer=s})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=textruntimeobject-pixi-renderer.js.map
Extensions/TextObject/textruntimeobject.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(r){class d extends r.RuntimeObject{constructor(t,s){super(t,s);this._useGradient=!1;this._gradient=[];this._gradientType="";this.opacity=255;this._wrapping=!1;this._wrappingWidth=100;this._padding=5;this._scaleX=1;this._scaleY=1;const e=s.content;this._characterSize=Math.max(1,e.characterSize),this._fontName=e.font,this._bold=e.bold,this._italic=e.italic,this._underlined=e.underlined,this._color=r.rgbOrHexToRGBColor(e.color),this._str=e.text,this._textAlign=e.textAlignment||"left",this._verticalTextAlignment=e.verticalTextAlignment||"top",this._isOutlineEnabled=e.isOutlineEnabled,this._outlineThickness=e.outlineThickness,this._outlineColor=r.rgbOrHexToRGBColor(e.outlineColor),this._shadow=e.isShadowEnabled,this._shadowColor=r.rgbOrHexToRGBColor(e.shadowColor),this._shadowOpacity=e.shadowOpacity,this._shadowDistance=e.shadowDistance,this._shadowBlur=e.shadowBlurRadius,this._shadowAngle=e.shadowAngle,this._renderer=new r.TextRuntimeObjectRenderer(this,t),this.onCreated()}updateFromObjectData(t,s){const e=t.content,i=s.content;return e.characterSize!==i.characterSize&&this.setCharacterSize(i.characterSize),e.font!==i.font&&this.setFontName(i.font),e.bold!==i.bold&&this.setBold(i.bold),e.italic!==i.italic&&this.setItalic(i.italic),e.color!==i.color&&this.setColor(i.color),e.text!==i.text&&this.setText(i.text),e.underlined!==i.underlined?!1:(e.textAlignment!==i.textAlignment&&this.setTextAlignment(i.textAlignment),e.verticalTextAlignment!==i.verticalTextAlignment&&this.setVerticalTextAlignment(i.verticalTextAlignment),e.isOutlineEnabled!==i.isOutlineEnabled&&this.setOutlineEnabled(i.isOutlineEnabled),e.outlineThickness!==i.outlineThickness&&this.setOutlineThickness(i.outlineThickness),e.outlineColor!==i.outlineColor&&this.setOutlineColor(i.outlineColor),e.isShadowEnabled!==i.isShadowEnabled&&this.showShadow(i.isShadowEnabled),e.shadowColor!==i.shadowColor&&this.setShadowColor(i.shadowColor),e.shadowOpacity!==i.shadowOpacity&&this.setShadowOpacity(i.shadowOpacity),e.shadowDistance!==i.shadowDistance&&this.setShadowDistance(i.shadowDistance),e.shadowAngle!==i.shadowAngle&&this.setShadowAngle(i.shadowAngle),e.shadowBlurRadius!==i.shadowBlurRadius&&this.setShadowBlurRadius(i.shadowBlurRadius),!0)}getNetworkSyncData(){return{...super.getNetworkSyncData(),str:this._str,o:this.opacity,cs:this._characterSize,fn:this._fontName,b:this._bold,i:this._italic,u:this._underlined,c:this._color,scale:this.getScale(),ta:this._textAlign,wrap:this._wrapping,wrapw:this._wrappingWidth,oena:this._isOutlineEnabled,ot:this._outlineThickness,oc:this._outlineColor,sh:this._shadow,shc:this._shadowColor,sho:this._shadowOpacity,shd:this._shadowDistance,sha:this._shadowAngle,shb:this._shadowBlur,pad:this._padding}}updateFromNetworkSyncData(t){super.updateFromNetworkSyncData(t),t.str!==void 0&&this.setText(t.str),t.o!==void 0&&this.setOpacity(t.o),t.cs!==void 0&&this.setCharacterSize(t.cs),t.fn!==void 0&&this.setFontName(t.fn),t.b!==void 0&&this.setBold(t.b),t.i!==void 0&&this.setItalic(t.i),t.u!==void 0&&(this._underlined=t.u),t.c!==void 0&&(this._color=t.c),t.scale!==void 0&&this.setScale(t.scale),t.ta!==void 0&&this.setTextAlignment(t.ta),t.ta!==void 0&&this.setVerticalTextAlignment(t.ta),t.wrap!==void 0&&this.setWrapping(t.wrap),t.wrapw!==void 0&&this.setWrappingWidth(t.wrapw),t.oena!==void 0&&this.setOutlineEnabled(t.oena),t.ot!==void 0&&this.setOutlineThickness(t.ot),t.oc!==void 0&&(this._outlineColor=t.oc),t.sh!==void 0&&this.showShadow(t.sh),t.shc!==void 0&&(this._shadowColor=t.shc),t.sho!==void 0&&this.setShadowOpacity(t.sho),t.shd!==void 0&&this.setShadowDistance(t.shd),t.sha!==void 0&&this.setShadowAngle(t.sha),t.shb!==void 0&&this.setShadowBlurRadius(t.shb),t.pad!==void 0&&this.setPadding(t.pad)}getRendererObject(){return this._renderer.getRendererObject()}update(t){this._renderer.ensureUpToDate()}onDestroyed(){super.onDestroyed(),this._renderer.destroy()}extraInitializationFromInitialInstance(t){t.customSize?(this.setWrappingWidth(t.width),this.setWrapping(!0)):this.setWrapping(!1),t.opacity!==void 0&&this.setOpacity(t.opacity)}_updateTextPosition(){this.invalidateHitboxes(),this._renderer.updatePosition()}setX(t){super.setX(t),this._updateTextPosition()}setY(t){super.setY(t),this._updateTextPosition()}setAngle(t){super.setAngle(t),this._renderer.updateAngle()}setOpacity(t){t<0&&(t=0),t>255&&(t=255),this.opacity=t,this._renderer.updateOpacity()}getOpacity(){return this.opacity}getString(){return this.getText()}setString(t){this.setText(t)}getText(){return this._str}setText(t){t!==this._str&&(this._str=t,this._renderer.updateString(),this._updateTextPosition())}getCharacterSize(){return this._characterSize}setCharacterSize(t){t<=1&&(t=1),this._characterSize=t,this._renderer.updateStyle()}setFontName(t){this._fontName=t,this._renderer.updateStyle()}isBold(){return this._bold}setBold(t){this._bold=t,this._renderer.updateStyle()}isItalic(){return this._italic}setItalic(t){this._italic=t,this._renderer.updateStyle()}getWidth(){return this._wrapping?this._wrappingWidth:this._renderer.getWidth()}getHeight(){return this._renderer.getHeight()}getScaleMean(){return(Math.abs(this._scaleX)+Math.abs(this._scaleY))/2}getScale(){const t=Math.abs(this._scaleX),s=Math.abs(this._scaleY);return t===s?t:Math.sqrt(t*s)}getScaleX(){return this._scaleX}getScaleY(){return this._scaleY}setScale(t){this._scaleX===t&&this._scaleY===t||(this._scaleX=t,this._scaleY=t,this._renderer.setScale(t),this.invalidateHitboxes())}setScaleX(t){this._scaleX!==t&&(this._scaleX=t,this._renderer.setScaleX(t),this.invalidateHitboxes())}setScaleY(t){this._scaleY!==t&&(this._scaleY=t,this._renderer.setScaleY(t),this.invalidateHitboxes())}setColor(t){const s=t.split(";");s.length<3||(this._color[0]=parseInt(s[0],10),this._color[1]=parseInt(s[1],10),this._color[2]=parseInt(s[2],10),this._useGradient=!1,this._renderer.updateStyle())}getColor(){return this._color[0]+";"+this._color[1]+";"+this._color[2]}setVerticalTextAlignment(t){this._verticalTextAlignment=t,this._renderer.updateStyle()}getVerticalTextAlignment(){return this._verticalTextAlignment}setTextAlignment(t){this._textAlign=t,this._renderer.updateStyle()}getTextAlignment(){return this._textAlign}isWrapping(){return this._wrapping}setWrapping(t){this._wrapping!==t&&(this._wrapping=t,this._renderer.updateStyle(),this.invalidateHitboxes())}getWrappingWidth(){return this._wrappingWidth}setWrappingWidth(t){t<=1&&(t=1),this._wrappingWidth!==t&&(this._wrappingWidth=t,this._wrapping&&(this._renderer.updateStyle(),this.invalidateHitboxes()))}setWidth(t){this.setWrappingWidth(t)}getDrawableY(){return this.getY()-(this._verticalTextAlignment==="center"?this.getHeight()/2:this._verticalTextAlignment==="bottom"?this.getHeight():0)}setOutline(t,s){const e=t.split(";");e.length<3||(this._outlineColor[0]=parseInt(e[0],10),this._outlineColor[1]=parseInt(e[1],10),this._outlineColor[2]=parseInt(e[2],10),this._outlineThickness=s,this._renderer.updateStyle())}isOutlineEnabled(){return this._isOutlineEnabled}setOutlineEnabled(t){this._isOutlineEnabled=t,this._renderer.updateStyle()}getOutlineThickness(){return this._outlineThickness}setOutlineThickness(t){this._outlineThickness=t,this._renderer.updateStyle()}setOutlineColor(t){this._outlineColor=r.rgbOrHexToRGBColor(t),this._renderer.updateStyle()}setShadow(t,s,e,i){const n=t.split(";");n.length<3||(this._shadowColor[0]=parseInt(n[0],10),this._shadowColor[1]=parseInt(n[1],10),this._shadowColor[2]=parseInt(n[2],10),this._shadowDistance=s,this._shadowBlur=e,this._shadowAngle=i,this._shadow=!0,this._renderer.updateStyle())}isShadowEnabled(){return this._shadow}showShadow(t){this._shadow=t,this._renderer.updateStyle()}getShadowOpacity(){return this._shadowOpacity}setShadowOpacity(t){this._shadowOpacity=t,this._renderer.updateStyle()}getShadowDistance(){return this._shadowDistance}setShadowDistance(t){this._shadowDistance=t,this._renderer.updateStyle()}getShadowAngle(){return this._shadowAngle}setShadowAngle(t){this._shadowAngle=t,this._renderer.updateStyle()}getShadowBlurRadius(){return this._shadowBlur}setShadowBlurRadius(t){this._shadowBlur=t,this._renderer.updateStyle()}setShadowColor(t){this._shadowColor=r.rgbOrHexToRGBColor(t),this._renderer.updateStyle()}setGradient(t,s,e,i,n){const o=s.split(";"),a=e.split(";"),h=i.split(";"),l=n.split(";");this._gradient=[],o.length==3&&this._gradient.push([parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10)]),a.length==3&&this._gradient.push([parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]),h.length==3&&this._gradient.push([parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)]),l.length==3&&this._gradient.push([parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)]),this._gradientType=t,this._useGradient=this._gradient.length>1,this._renderer.updateStyle()}getPadding(){return this._padding}setPadding(t){this._padding=t,this._renderer.updateStyle()}}r.TextRuntimeObject=d,r.registerObject("TextObject::Text",r.TextRuntimeObject)})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=textruntimeobject.js.map
LICENSE.GDevelop.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Part of this app is using the GDevelop game engine, which is licensed under the MIT license.
2
+ Find more information on https://gdevelop.io/.
Model3DManager.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(d){const a=new d.Logger("Model3DManager"),i=["model3D"];class l{constructor(r){this._loadedThreeModels=new d.ResourceCache;this._downloadedArrayBuffers=new d.ResourceCache;this._loader=null;this._dracoLoader=null;if(this._resourceLoader=r,typeof THREE!="undefined"){this._loader=new THREE_ADDONS.GLTFLoader,this._dracoLoader=new THREE_ADDONS.DRACOLoader,this._dracoLoader.setDecoderPath("./pixi-renderers/draco/gltf/"),this._loader.setDRACOLoader(this._dracoLoader);const e=new THREE.Group;e.add(new THREE.Mesh(new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:"#ff00ff"}))),this._invalidModel={scene:e,animations:[],cameras:[],scenes:[],asset:{},userData:{},parser:null}}}getResourceKinds(){return i}async processResource(r){const e=this._resourceLoader.getResource(r);if(!e){a.warn('Unable to find texture for resource "'+r+'".');return}const t=this._loader;if(!t)return;const s=this._downloadedArrayBuffers.get(e);if(!!s){this._downloadedArrayBuffers.delete(e);try{const o=await t.parseAsync(s,"");this._loadedThreeModels.set(e,o)}catch(o){a.error("Can't fetch the 3D model file "+e.file+", error: "+o)}}}async loadResource(r){const e=this._resourceLoader.getResource(r);if(!e){a.warn('Unable to find texture for resource "'+r+'".');return}if(!this._loader||this._loadedThreeModels.get(e))return;const s=this._resourceLoader.getFullUrl(e.file);try{const o=await fetch(s,{credentials:this._resourceLoader.checkIfCredentialsRequired(s)?"include":"omit"});if(!o.ok)throw new Error("Network response was not ok");const n=await o.arrayBuffer();this._downloadedArrayBuffers.set(e,n)}catch(o){a.error("Can't fetch the 3D model file "+e.file+", error: "+o)}}getModel(r){return this._loadedThreeModels.getFromName(r)||this._invalidModel}dispose(){this._loadedThreeModels.clear(),this._downloadedArrayBuffers.clear(),this._loader=null,this._dracoLoader=null,this._invalidModel&&(this._invalidModel.cameras=[],this._invalidModel.animations=[],this._invalidModel.scenes=[],this._invalidModel.userData={},this._invalidModel.asset={},this._invalidModel.scene.clear())}}d.Model3DManager=l})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=Model3DManager.js.map
ResourceCache.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(a){class n{constructor(){this._nameToContent=new Map;this._fileToContent=new Map}getFromName(e){return this._nameToContent.get(e)||null}get(e){let t=this._nameToContent.get(e.name);return t||(t=this._fileToContent.get(e.file),t?(this._nameToContent.set(e.name,t),t):null)}set(e,t){this._nameToContent.set(e.name,t),this._fileToContent.set(e.file,t)}delete(e){this._nameToContent.delete(e.name),this._fileToContent.delete(e.file)}clear(){this._nameToContent.clear(),this._fileToContent.clear()}}a.ResourceCache=n})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=ResourceCache.js.map
ResourceLoader.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(i){const c=new i.Logger("ResourceLoader"),f=(t,e,s)=>{if(t.startsWith("data:")||t.startsWith("blob:"))return t;const n=t.indexOf("?")===-1?"?":"&";return t+n+e+"="+s},_=t=>t.startsWith("https://project-resources.gdevelop.io/")||t.startsWith("https://project-resources-dev.gdevelop.io/"),g=20,R=5,d=3;class v{constructor(e){this.isFinished=!1;this.sceneName=e,this.onProgressCallbacks=new Array,this.onFinishCallbacks=new Array}registerCallback(e,s){if(this.isFinished){e();return}this.onFinishCallbacks.push(e),s&&this.onProgressCallbacks.push(s)}onProgress(e,s){for(const n of this.onProgressCallbacks)n(e,s)}onFinish(){this.isFinished=!0;for(const e of this.onFinishCallbacks)e()}}class w{constructor(e,s,n,r){this._sceneToLoadQueue=new Array;this._spineAtlasManager=null;this._spineManager=null;this.currentLoadingSceneName="";this.currentSceneLoadingProgress=0;this._isLoadingInForeground=!0;this._runtimeGame=e,this._resources=new Map,this._globalResources=n,this._sceneResources=new Map,this._sceneNamesToLoad=new Set,this._sceneNamesToMakeReady=new Set,this.setResources(s,n,r),this._imageManager=new i.ImageManager(this),this._soundManager=new i.SoundManager(this),this._fontManager=new i.FontManager(this),this._jsonManager=new i.JsonManager(this),this._bitmapFontManager=new i.BitmapFontManager(this,this._imageManager),this._model3DManager=new i.Model3DManager(this),i.SpineAtlasManager&&i.SpineManager&&(this._spineAtlasManager=new i.SpineAtlasManager(this,this._imageManager),this._spineManager=new i.SpineManager(this,this._spineAtlasManager));const a=[this._imageManager,this._soundManager,this._fontManager,this._jsonManager,this._bitmapFontManager,this._model3DManager];this._spineAtlasManager&&a.push(this._spineAtlasManager),this._spineManager&&a.push(this._spineManager),this._resourceManagersMap=new Map;for(const o of a)for(const u of o.getResourceKinds())this._resourceManagersMap.set(u,o)}getRuntimeGame(){return this._runtimeGame}setResources(e,s,n){this._globalResources=s,this._sceneResources.clear(),this._sceneNamesToLoad.clear(),this._sceneNamesToMakeReady.clear();for(const r of n)this._sceneResources.set(r.name,r.usedResources.map(a=>a.name)),this._sceneNamesToLoad.add(r.name),this._sceneNamesToMakeReady.add(r.name);this._sceneToLoadQueue.length=0;for(let r=n.length-1;r>=0;r--){const a=n[r];this._sceneToLoadQueue.push(new v(a.name))}this._resources.clear();for(const r of e)!r.file||this._resources.set(r.name,r)}async loadAllResources(e){let s=0;await h([...this._resources.values()],g,d,async n=>{await this._loadResource(n),await this._processResource(n),s++,e(s,this._resources.size)}),this._sceneNamesToLoad.clear(),this._sceneNamesToMakeReady.clear()}async loadGlobalAndFirstSceneResources(e,s){const n=this._sceneResources.get(e);if(!n){c.warn(`Can't load resource for unknown scene: "`+e+'".');return}let r=0;const a=[...this._globalResources,...n.values()];await h(a,g,d,async o=>{const u=this._resources.get(o);if(!u){c.warn('Unable to find resource "'+o+'".');return}await this._loadResource(u),await this._processResource(u),r++,s(r,a.length)}),this._setSceneAssetsLoaded(e),this._setSceneAssetsReady(e)}async loadAllSceneInBackground(){for(;this._sceneToLoadQueue.length>0;){const e=this._sceneToLoadQueue[this._sceneToLoadQueue.length-1];e!==void 0&&(this.currentLoadingSceneName=e.sceneName,this.areSceneAssetsLoaded(e.sceneName)?this._sceneToLoadQueue.pop():(await this._doLoadSceneResources(e.sceneName,async(s,n)=>e.onProgress(s,n)),this._sceneToLoadQueue.splice(this._sceneToLoadQueue.findIndex(s=>s===e),1),e.onFinish()))}this.currentLoadingSceneName=""}async _doLoadSceneResources(e,s){const n=this._sceneResources.get(e);if(!n){c.warn(`Can't load resource for unknown scene: "`+e+'".');return}let r=0;await h([...n.values()],this._isLoadingInForeground?g:R,d,async a=>{const o=this._resources.get(a);if(!o){c.warn('Unable to find resource "'+a+'".');return}await this._loadResource(o),r++,this.currentSceneLoadingProgress=r/this._resources.size,s&&await s(r,this._resources.size)}),this._setSceneAssetsLoaded(e)}async _loadResource(e){const s=this._resourceManagersMap.get(e.kind);if(!s){c.warn('Unknown resource kind: "'+e.kind+'" for: "'+e.name+'".');return}await s.loadResource(e.name)}async loadAndProcessSceneResources(e,s){if(this.areSceneAssetsReady(e))return;await this.loadSceneResources(e,s);const n=this._sceneResources.get(e);if(!n){c.warn(`Can't load resource for unknown scene: "`+e+'".');return}let r=0;for(const a of n){const o=this._resources.get(a);if(!o){c.warn('Unable to find resource "'+a+'".');continue}await this._processResource(o),r++,s&&await s(r,n.length)}this._setSceneAssetsReady(e)}async loadSceneResources(e,s){this._isLoadingInForeground=!0;const n=this._prioritizeScene(e);return new Promise((r,a)=>{if(!n){this._isLoadingInForeground=!1,r();return}n.registerCallback(()=>{this._isLoadingInForeground=!1,r()},s)})}dispose(){for(const e of this._resourceManagersMap.values())e.dispose()}_prioritizeScene(e){const s=this._sceneToLoadQueue.findIndex(r=>r.sceneName===e);if(s<0)return null;const n=this._sceneToLoadQueue[s];return this._sceneToLoadQueue.splice(s,1),this._sceneToLoadQueue.push(n),n}async _processResource(e){const s=this._resourceManagersMap.get(e.kind);if(!s){c.warn('Unknown resource kind: "'+e.kind+'" for: "'+e.name+'".');return}await s.processResource(e.name)}getSceneLoadingProgress(e){return e===this.currentLoadingSceneName?this.currentSceneLoadingProgress:this.areSceneAssetsLoaded(e)?1:0}areSceneAssetsLoaded(e){return!this._sceneNamesToLoad.has(e)}areSceneAssetsReady(e){return!this._sceneNamesToMakeReady.has(e)}_setSceneAssetsLoaded(e){this._sceneNamesToLoad.delete(e)}_setSceneAssetsReady(e){this._sceneNamesToMakeReady.delete(e)}getResource(e){return this._resources.get(e)||null}getFullUrl(e){const{gdevelopResourceToken:s}=this._runtimeGame._options;return!s||!_(e)?e:f(e,"gd_resource_token",encodeURIComponent(s))}checkIfCredentialsRequired(e){return this._runtimeGame._options.gdevelopResourceToken?!1:!!_(e)}getSoundManager(){return this._soundManager}getImageManager(){return this._imageManager}getFontManager(){return this._fontManager}getBitmapFontManager(){return this._bitmapFontManager}getJsonManager(){return this._jsonManager}getModel3DManager(){return this._model3DManager}getSpineManager(){return this._spineManager}getSpineAtlasManager(){return this._spineAtlasManager}}i.ResourceLoader=w;const p=(t,e,s)=>{const n=[],r=[];let a=0,o=0;return new Promise((u,y)=>{const m=()=>{if(t.length===0){u({results:n,errors:r});return}for(;a<e&&o<t.length;){const M=t[o++];a++,s(M).then(l=>n.push(l)).catch(l=>r.push({item:M,error:l})).finally(()=>{a--,o===t.length&&a===0?u({results:n,errors:r}):m()})}};m()})},h=async(t,e,s,n)=>{const r=await p(t,e,n);r.errors.length!==0&&c.warn("Some assets couldn't be downloaded. Trying again now.");for(let a=1;a<s&&r.errors.length!==0;a++){const o=await p(t,e,n);r.results.push.apply(r.results,o.results),r.errors=o.errors}return r}})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=ResourceLoader.js.map
RuntimeCustomObjectLayer.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(o){class n extends o.RuntimeLayer{constructor(e,a){super(e,a);this._renderer.onCreated()}onGameResolutionResized(e,a){}getCameraX(e){return 0}getCameraY(e){return 0}setCameraX(e,a){}setCameraY(e,a){}getCameraWidth(e){return 0}getCameraHeight(e){return 0}setCameraZoom(e,a){}getCameraZoom(e){return 1}setCameraZ(e,a,r){}getCameraZ(e,a){return 0}getCameraRotation(e){return 0}setCameraRotation(e,a){}convertCoords(e,a,r,t){return this._runtimeScene.convertCoords(e,a,t||[0,0])}convertInverseCoords(e,a,r,t){return this._runtimeScene.convertInverseCoords(e,a,t||[0,0])}applyLayerInverseTransformation(e,a,r,t){return t[0]=e,t[1]=a,t}applyLayerTransformation(e,a,r,t){return t[0]=e,t[1]=a,t}}o.RuntimeCustomObjectLayer=n})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=RuntimeCustomObjectLayer.js.map
RuntimeInstanceContainer.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(l){const d=new l.Logger("RuntimeInstanceContainer");class u{constructor(){this._allInstancesList=[];this._allInstancesListIsUpToDate=!0;this._instancesRemoved=[];this._layersCameraCoordinates={};this._debugDrawEnabled=!1;this._debugDrawShowHiddenInstances=!1;this._debugDrawShowPointsNames=!1;this._debugDrawShowCustomPoints=!1;this._initialBehaviorSharedData=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objects=new Hashtable,this._objectsCtor=new Hashtable,this._layers=new Hashtable,this._orderedLayers=[]}enableDebugDraw(e,t,s,a){this._debugDrawEnabled&&!e&&this.getDebuggerRenderer().clearDebugDraw(),this._debugDrawEnabled=e,this._debugDrawShowHiddenInstances=t,this._debugDrawShowPointsNames=s,this._debugDrawShowCustomPoints=a}isObjectRegistered(e){return this._objects.containsKey(e)&&this._instances.containsKey(e)&&this._objectsCtor.containsKey(e)}registerObject(e){this._objects.put(e.name,e),this._instances.put(e.name,[]);const t=l.getObjectConstructor(e.type);this._objectsCtor.put(e.name,t),t.supportsReinitialization&&this._instancesCache.put(e.name,[])}updateObject(e){this.isObjectRegistered(e.name)||d.warn("Tried to call updateObject for an object that was not registered ("+e.name+"). Call registerObject first."),this._objects.put(e.name,e)}unregisterObject(e){const t=this._instances.get(e);if(t){const s=t.slice();for(let a=0;a<s.length;a++)this.markObjectForDeletion(s[a]);this._cacheOrClearRemovedInstances()}this._objects.remove(e),this._instances.remove(e),this._instancesCache.remove(e),this._objectsCtor.remove(e)}createObjectsFrom(e,t,s,a,n){let i,r;arguments.length===5?(i=a,r=n):(i=0,r=arguments[3]);for(let h=0,g=e.length;h<g;++h){const o=e[h],_=o.name,c=this.createObject(_);c!==null&&(r&&(c.persistentUuid=o.persistentUuid||null),c.setPosition(o.x+t,o.y+s),c.setAngle(o.angle),l.Base3DHandler&&l.Base3DHandler.is3D(c)&&(c.setZ((o.z||0)+i),o.rotationX!==void 0&&c.setRotationX(o.rotationX),o.rotationY!==void 0&&c.setRotationY(o.rotationY)),c.setZOrder(o.zOrder),c.setLayer(o.layer),c.getVariables().initFrom(o.initialVariables,!0),c.extraInitializationFromInitialInstance(o))}}getInitialSharedDataForBehavior(e){return this._initialBehaviorSharedData.get(e)}setInitialSharedDataForBehavior(e,t){this._initialBehaviorSharedData.put(e,t)}_setLayerDefaultZOrders(){if(this.getGame().getGameData().properties.useDeprecatedZeroAsDefaultZOrder)return;const e={},t=this.getAdhocListOfAllInstances();for(let s=0,a=t.length;s<a;++s){const n=t[s];let i=n.getLayer();const r=n.getZOrder();(e[i]===void 0||e[i]<r)&&(e[i]=r)}for(let s in e)this.getLayer(s).setDefaultZOrder(e[s]+1)}_updateLayersCameraCoordinates(e){this._layersCameraCoordinates=this._layersCameraCoordinates||{};for(const t in this._layers.items)if(this._layers.items.hasOwnProperty(t)){const s=this._layers.items[t];this._layersCameraCoordinates[t]=this._layersCameraCoordinates[t]||[0,0,0,0],this._layersCameraCoordinates[t][0]=s.getCameraX()-s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][1]=s.getCameraY()-s.getCameraHeight()/2*e,this._layersCameraCoordinates[t][2]=s.getCameraX()+s.getCameraWidth()/2*e,this._layersCameraCoordinates[t][3]=s.getCameraY()+s.getCameraHeight()/2*e}}_updateLayersPreRender(){for(const e of this._orderedLayers)e.updatePreRender(this)}_updateObjectsPreRender(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getRendererObject();n&&(n.visible=!a.isHidden(),n.visible&&this.getGame().getEffectsManager().updatePreRender(a.getRendererEffects(),a)),a.updatePreRender(this)}}_cacheOrClearRemovedInstances(){for(let e=0,t=this._instancesRemoved.length;e<t;++e){const s=this._instancesRemoved[e],a=this._instancesCache.get(s.getName());a&&a.length<128&&a.push(s),s.onDestroyed()}this._instancesRemoved.length=0}_constructListOfAllInstances(){let e=0;for(const t in this._instances.items)if(this._instances.items.hasOwnProperty(t)){const s=this._instances.items[t],a=e;e+=s.length;for(let n=0,i=s.length;n<i;++n)a+n<this._allInstancesList.length?this._allInstancesList[a+n]=s[n]:this._allInstancesList.push(s[n])}this._allInstancesList.length=e,this._allInstancesListIsUpToDate=!0}getInstancesOf(e){return this._instances.items[e]}getAdhocListOfAllInstances(){return this._allInstancesListIsUpToDate||this._constructListOfAllInstances(),this._allInstancesList}_updateObjectsPreEvents(){const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t){const a=e[t],n=a.getElapsedTime();if(a.hasNoForces())a.update(this);else{const i=a.getAverageForce(),r=n/1e3;a.setX(a.getX()+i.getX()*r),a.setY(a.getY()+i.getY()*r),a.update(this),a.updateForces(r)}a.updateTimers(n),e[t].stepBehaviorsPreEvents(this)}this._cacheOrClearRemovedInstances()}_updateObjectsPostEvents(){this._cacheOrClearRemovedInstances();const e=this.getAdhocListOfAllInstances();for(let t=0,s=e.length;t<s;++t)e[t].stepBehaviorsPostEvents(this);this._cacheOrClearRemovedInstances()}addObject(e){this._instances.containsKey(e.name)||this._instances.put(e.name,[]),this._instances.get(e.name).push(e),this._allInstancesListIsUpToDate=!1}getObjects(e){return this._instances.containsKey(e)||(d.info('RuntimeScene.getObjects: No instances called "'+e+'"! Adding it.'),this._instances.put(e,[])),this._instances.get(e)}createObject(e){if(!this._objectsCtor.containsKey(e)||!this._objects.containsKey(e))return null;const t=this._instancesCache.get(e),s=this._objectsCtor.get(e);let a;return!t||t.length===0?a=new s(this,this._objects.get(e)):(a=t.pop(),a.reinitialize(this._objects.get(e))),this.addObject(a),a}markObjectForDeletion(e){if(this._instancesRemoved.indexOf(e)===-1&&this._instancesRemoved.push(e),this._instances.containsKey(e.getName())){const t=e.id,s=this._instances.get(e.getName());for(let a=0,n=s.length;a<n;++a)if(s[a].id==t){s.splice(a,1),this._allInstancesListIsUpToDate=!1;break}}e.onDeletedFromScene(this);for(let t=0;t<l.callbacksObjectDeletedFromScene.length;++t)l.callbacksObjectDeletedFromScene[t](this,e)}getLayer(e){return this._layers.containsKey(e)?this._layers.get(e):this._layers.get("")}hasLayer(e){return this._layers.containsKey(e)}removeLayer(e){const t=this._layers.get(e);if(!t)return;const s=this.getAdhocListOfAllInstances();for(let n=0;n<s.length;++n){const i=s[n];i.getLayer()===e&&i.setLayer("")}this._layers.remove(e);const a=this._orderedLayers.indexOf(t);this._orderedLayers.splice(a,1)}setLayerIndex(e,t){const s=this._layers.get(e);if(!s)return;const a=this._orderedLayers.indexOf(s);a!==t&&(this._orderedLayers.splice(a,1),this._orderedLayers.splice(t,0,s),this.getRenderer().setLayerIndex(s,t))}getAllLayerNames(e){this._layers.keys(e)}getInstancesCountOnScene(e){const t=this._instances.get(e);return t?t.length:0}updateObjectsForces(){for(const e in this._instances.items)if(this._instances.items.hasOwnProperty(e)){const t=this._instances.items[e];for(let s=0,a=t.length;s<a;++s){const n=t[s];if(!n.hasNoForces()){const i=n.getAverageForce(),r=n.getElapsedTime()/1e3;n.setX(n.getX()+i.getX()*r),n.setY(n.getY()+i.getY()*r),n.updateForces(r)}}}}_destroy(){this._layers=new Hashtable,this._orderedLayers=[],this._objects=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objectsCtor=new Hashtable,this._allInstancesList=[],this._instancesRemoved=[]}}l.RuntimeInstanceContainer=u})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=RuntimeInstanceContainer.js.map
RuntimeLayer.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(i){let n;(function(r){r[r.TWO_D=0]="TWO_D",r[r.THREE_D=1]="THREE_D",r[r.TWO_D_PLUS_THREE_D=2]="TWO_D_PLUS_THREE_D"})(n=i.RuntimeLayerRenderingType||(i.RuntimeLayerRenderingType={}));const f=a=>a==="3d"?1:a==="2d+3d"||a===""?2:0;let s;(function(t){t[t.PERSPECTIVE=0]="PERSPECTIVE",t[t.ORTHOGRAPHIC=1]="ORTHOGRAPHIC"})(s=i.RuntimeLayerCameraType||(i.RuntimeLayerCameraType={}));const l=a=>a==="orthographic"?1:0;let o;(function(t){t[t.DO_NOTHING=0]="DO_NOTHING",t[t.TOP_LEFT_ANCHORED_IF_NEVER_MOVED=1]="TOP_LEFT_ANCHORED_IF_NEVER_MOVED"})(o=i.RuntimeLayerDefaultCameraBehavior||(i.RuntimeLayerDefaultCameraBehavior={}));const c=a=>a==="top-left-anchored-if-never-moved"?1:0;class d{constructor(e,t){this._timeScale=1;this._defaultZOrder=0;this._rendererEffects={};this._name=e.name,this._renderingType=f(e.renderingType),this._cameraType=l(e.cameraType),this._defaultCameraBehavior=c(e.defaultCameraBehavior||"top-left-anchored-if-never-moved"),this._hidden=!e.visibility,this._initialCamera3DFieldOfView=e.camera3DFieldOfView||45,this._initialCamera3DNearPlaneDistance=e.camera3DNearPlaneDistance||.1,this._initialCamera3DFarPlaneDistance=e.camera3DFarPlaneDistance||2e3,this._initialEffectsData=e.effects||[],this._runtimeScene=t,this._effectsManager=t.getGame().getEffectsManager(),this._isLightingLayer=e.isLightingLayer,this._followBaseLayerCamera=e.followBaseLayerCamera,this._clearColor=[e.ambientLightColorR/255,e.ambientLightColorG/255,e.ambientLightColorB/255,1],this._renderer=new i.LayerRenderer(this,t.getRenderer(),t.getGame().getRenderer()),this.show(!this._hidden);for(let r=0;r<e.effects.length;++r)this.addEffect(e.effects[r])}getRenderer(){return this._renderer}getRendererObject(){return this._renderer.getRendererObject()}get3DRendererObject(){return this._renderer.getThreeScene()}getRenderingType(){return this._renderingType}getCameraType(){return this._cameraType}getDefaultZOrder(){return this._defaultZOrder}setDefaultZOrder(e){this._defaultZOrder=e}getRuntimeScene(){return this._runtimeScene.getScene()}updatePreRender(e){this._followBaseLayerCamera&&this.followBaseLayer(),this._renderer.updatePreRender(),this._effectsManager.updatePreRender(this._rendererEffects,this)}getName(){return this._name}show(e){this._hidden=!e,this._renderer.updateVisibility(e)}isVisible(){return!this._hidden}getWidth(){return this._runtimeScene.getViewportWidth()}getHeight(){return this._runtimeScene.getViewportHeight()}getInitialCamera3DFieldOfView(){return this._initialCamera3DFieldOfView}getInitialCamera3DNearPlaneDistance(){return this._initialCamera3DNearPlaneDistance}getInitialCamera3DFarPlaneDistance(){return this._initialCamera3DFarPlaneDistance}getInitialEffectsData(){return this._initialEffectsData}getRendererEffects(){return this._rendererEffects}addEffect(e){this._effectsManager.addEffect(e,this._rendererEffects,this)}removeEffect(e){this._effectsManager.removeEffect(this._rendererEffects,this,e)}setEffectDoubleParameter(e,t,r){this._effectsManager.setEffectDoubleParameter(this._rendererEffects,e,t,r)}setEffectStringParameter(e,t,r){this._effectsManager.setEffectStringParameter(this._rendererEffects,e,t,r)}setEffectBooleanParameter(e,t,r){this._effectsManager.setEffectBooleanParameter(this._rendererEffects,e,t,r)}enableEffect(e,t){this._effectsManager.enableEffect(this._rendererEffects,this,e,t)}isEffectEnabled(e){return this._effectsManager.isEffectEnabled(this._rendererEffects,this,e)}hasEffect(e){return this._effectsManager.hasEffect(this._rendererEffects,e)}setTimeScale(e){e>=0&&(this._timeScale=e)}getTimeScale(){return this._timeScale}getElapsedTime(e){return(e||this._runtimeScene).getElapsedTime()*this._timeScale}followBaseLayer(){const e=this._runtimeScene.getLayer("");this.setCameraX(e.getCameraX()),this.setCameraY(e.getCameraY()),this.setCameraRotation(e.getCameraRotation()),this.setCameraZoom(e.getCameraZoom())}getClearColor(){return this._clearColor}setClearColor(e,t,r){this._clearColor[0]=e/255,this._clearColor[1]=t/255,this._clearColor[2]=r/255,this._renderer.updateClearColor()}setFollowBaseLayerCamera(e){this._followBaseLayerCamera=e}isLightingLayer(){return this._isLightingLayer}}i.RuntimeLayer=d})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=RuntimeLayer.js.map
SpriteAnimator.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(a){class c{constructor(t,i){this.center={x:0,y:0};this.origin={x:0,y:0};this.hasCustomHitBoxes=!1;this.customHitBoxes=[];this.image=t?t.image:"",this.texture=i.getAnimationFrameTexture(this.image),this.points=new Hashtable,this.reinitialize(t,i)}reinitialize(t,i){this.image=t.image,this.texture=i.getAnimationFrameTexture(this.image),this.points.clear();for(let n=0,o=t.points.length;n<o;++n){const m=t.points[n],s={x:m.x,y:m.y};this.points.put(m.name,s)}const e=t.originPoint;this.origin.x=e.x,this.origin.y=e.y;const r=t.centerPoint;if(r.automatic!==!0?(this.center.x=r.x,this.center.y=r.y):(this.center.x=i.getAnimationFrameWidth(this.texture)/2,this.center.y=i.getAnimationFrameHeight(this.texture)/2),t.hasCustomCollisionMask){this.hasCustomHitBoxes=!0;let n=0;for(let o=t.customCollisionMask.length;n<o;++n){const m=t.customCollisionMask[n];n>=this.customHitBoxes.length&&this.customHitBoxes.push(new a.Polygon);let s=0;for(const u=m.length;s<u;++s){const l=m[s];s>=this.customHitBoxes[n].vertices.length&&this.customHitBoxes[n].vertices.push([0,0]),this.customHitBoxes[n].vertices[s][0]=l.x,this.customHitBoxes[n].vertices[s][1]=l.y}this.customHitBoxes[n].vertices.length=s}this.customHitBoxes.length=n}else this.customHitBoxes.length=0}getPoint(t){return t==="Centre"||t==="Center"?this.center:t==="Origin"?this.origin:this.points.containsKey(t)?this.points.get(t):this.origin}}a.SpriteAnimationFrame=c;class _{constructor(t,i){this.frames=[];this.timeBetweenFrames=t?t.timeBetweenFrames:1,this.loop=!!t.looping,this.reinitialize(t,i)}reinitialize(t,i){this.timeBetweenFrames=t?t.timeBetweenFrames:1,this.loop=!!t.looping;let e=0;for(const r=t.sprites.length;e<r;++e){const n=t.sprites[e];e<this.frames.length?this.frames[e].reinitialize(n,i):this.frames.push(new a.SpriteAnimationFrame(n,i))}this.frames.length=e}}a.SpriteAnimationDirection=_;class p{constructor(t,i){this.directions=[];this.hasMultipleDirections=!!t.useMultipleDirections,this.name=t.name||"",this.reinitialize(t,i)}reinitialize(t,i){this.hasMultipleDirections=!!t.useMultipleDirections,this.name=t.name||"";let e=0;for(const r=t.directions.length;e<r;++e){const n=t.directions[e];e<this.directions.length?this.directions[e].reinitialize(n,i):this.directions.push(new a.SpriteAnimationDirection(n,i))}this.directions.length=e}}a.SpriteAnimation=p;class g{constructor(t,i){this._animations=[];this._animationFrame=null;this._animationFrameDirty=!0;this._currentAnimation=0;this._currentDirection=0;this._currentFrameIndex=0;this._animationElapsedTime=0;this._animationSpeedScale=1;this._animationPaused=!1;this._onFrameChange=null;this._textureManager=i;for(let e=0,r=t.length;e<r;++e)this._animations.push(new a.SpriteAnimation(t[e],i))}invalidateFrame(){this._animationFrameDirty=!0,this._onFrameChange&&this._onFrameChange()}reinitialize(t){this._currentAnimation=0,this._currentDirection=0,this._currentFrameIndex=0,this._animationElapsedTime=0,this._animationSpeedScale=1,this._animationPaused=!1;let i=0;for(const e=t.length;i<e;++i){const r=t[i];i<this._animations.length?this._animations[i].reinitialize(r,this._textureManager):this._animations.push(new a.SpriteAnimation(r,this._textureManager))}this._animations.length=i,this._animationFrame=null,this.invalidateFrame()}updateFromObjectData(t,i){let e=0;for(const n=i.length;e<n;++e){const o=i[e];e<this._animations.length?this._animations[e].reinitialize(o,this._textureManager):this._animations.push(new a.SpriteAnimation(o,this._textureManager))}return this._animations.length=e,this.invalidateFrame(),this.getCurrentFrame()||this.setAnimationIndex(0),!0}getNetworkSyncData(){return{an:this._currentAnimation,di:this._currentDirection,fr:this._currentFrameIndex,et:this._animationElapsedTime,ss:this._animationSpeedScale,pa:this._animationPaused}}updateFromNetworkSyncData(t){this._currentAnimation=t.an,this._currentDirection=t.di,this._currentFrameIndex=t.fr,this._animationElapsedTime=t.et,this._animationSpeedScale=t.ss,this._animationPaused=t.pa,this.invalidateFrame()}getCurrentFrame(){if(!this._animationFrameDirty)return this._animationFrame;if(this._animationFrameDirty=!1,this._currentAnimation<this._animations.length&&this._currentDirection<this._animations[this._currentAnimation].directions.length){const t=this._animations[this._currentAnimation].directions[this._currentDirection];if(this._currentFrameIndex<t.frames.length)return this._animationFrame=t.frames[this._currentFrameIndex],this._animationFrame}return this._animationFrame=null,this._animationFrame}step(t){if(this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return!1;const i=this._animations[this._currentAnimation].directions[this._currentDirection],e=this.getAnimationDuration();if(!this._animationPaused&&(i.loop||this._animationElapsedTime!==e)&&i.timeBetweenFrames){const r=this._animationElapsedTime+t*this._animationSpeedScale;return this.setAnimationElapsedTime(i.loop?a.evtTools.common.mod(r,e):a.evtTools.common.clamp(r,0,e))}return!1}setOnFrameChangeCallback(t){this._onFrameChange=t}getAnimationIndex(){return this._currentAnimation}setAnimationIndex(t){return t=t|0,t<this._animations.length&&this._currentAnimation!==t&&t>=0?(this._currentAnimation=t,this._currentFrameIndex=0,this._animationElapsedTime=0,this.invalidateFrame(),!0):!1}getAnimationName(){return this._currentAnimation>=this._animations.length?"":this._animations[this._currentAnimation].name}setAnimationName(t){if(!t)return!1;for(let i=0;i<this._animations.length;++i)if(this._animations[i].name===t)return this.setAnimationIndex(i),!0;return!1}hasAnimationEnded(){if(this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return!0;const t=this._animations[this._currentAnimation].directions[this._currentDirection];return t.loop?!1:this._currentFrameIndex===t.frames.length-1&&this._animationElapsedTime===t.frames.length*t.timeBetweenFrames}isAnimationPaused(){return this._animationPaused}pauseAnimation(){this._animationPaused=!0}resumeAnimation(){this._animationPaused=!1}getAnimationSpeedScale(){return this._animationSpeedScale}setAnimationSpeedScale(t){this._animationSpeedScale=t}setAnimationFrameIndex(t){if(this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return!1;const i=this._animations[this._currentAnimation].directions[this._currentDirection];return t>=0&&t<i.frames.length&&t!==this._currentFrameIndex?(this._currentFrameIndex=t,this._animationElapsedTime=t*i.timeBetweenFrames,this.invalidateFrame(),!0):!1}getAnimationFrameIndex(){return this._currentFrameIndex}getAnimationElapsedTime(){return this._animationElapsedTime}setAnimationElapsedTime(t){const i=this._animations[this._currentAnimation].directions[this._currentDirection];this._animationElapsedTime=a.evtTools.common.clamp(t,0,this.getAnimationDuration());const e=this._currentFrameIndex;return this._currentFrameIndex=Math.min(Math.floor(this._animationElapsedTime/i.timeBetweenFrames),i.frames.length-1),e!==this._currentFrameIndex?(this.invalidateFrame(),!0):!1}getAnimationDuration(){const t=this._animations[this._currentAnimation].directions[this._currentDirection];return t.frames.length*t.timeBetweenFrames}getAnimationFrameCount(){if(this._currentAnimation>=this._animations.length)return 0;const t=this._animations[this._currentAnimation];return this._currentDirection>=t.directions.length?0:t.directions[this._currentDirection].frames.length}setDirectionOrAngle(t,i){if(this._currentAnimation>=this._animations.length)return null;const e=this._animations[this._currentAnimation];return e.hasMultipleDirections?(i=i|0,i===this._currentDirection||i>=e.directions.length||e.directions[i].frames.length===0?null:(this._currentDirection=i,this._currentFrameIndex=0,this._animationElapsedTime=0,this.invalidateFrame(),0)):t===i?null:i}getDirectionOrAngle(t){return this._currentAnimation>=this._animations.length?0:this._animations[this._currentAnimation].hasMultipleDirections?this._currentDirection:t}getAngle(t){return this._currentAnimation>=this._animations.length?0:this._animations[this._currentAnimation].hasMultipleDirections?this._currentDirection*45:t}setAngle(t,i){return this._currentAnimation>=this._animations.length?null:this._animations[this._currentAnimation].hasMultipleDirections?(i=i%360,i<0&&(i+=360),this.setDirectionOrAngle(t,Math.round(i/45)%8)):t===i?null:i}hasAnimationEndedLegacy(){if(this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return!0;const t=this._animations[this._currentAnimation].directions[this._currentDirection];return t.loop?!1:this._currentFrameIndex===t.frames.length-1}}a.SpriteAnimator=g})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=SpriteAnimator.js.map
Start button.png ADDED
affinetransformation.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(c){class y{constructor(){this.matrix=new Float32Array([1,0,0,1,0,0])}setToIdentity(){const o=this.matrix;o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0}isIdentity(){const o=this.matrix;return o[0]===1&&o[1]===0&&o[2]===0&&o[3]===1&&o[4]===0&&o[5]===0}equals(o){const t=this.matrix,a=o.matrix;return this===o||t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]}nearlyEquals(o,t){const a=this.matrix,s=o.matrix;return this===o||c.nearlyEqual(a[0],s[0],t)&&c.nearlyEqual(a[1],s[1],t)&&c.nearlyEqual(a[2],s[2],t)&&c.nearlyEqual(a[3],s[3],t)&&c.nearlyEqual(a[4],s[4],t)&&c.nearlyEqual(a[5],s[5],t)}copyFrom(o){const t=this.matrix,a=o.matrix;return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],this}setToTranslation(o,t){const a=this.matrix;a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=o,a[5]=t}translate(o,t){var a=this.matrix;a[4]=a[0]*o+a[2]*t+a[4],a[5]=a[1]*o+a[3]*t+a[5]}setToScale(o,t){const a=this.matrix;a[0]=o,a[1]=0,a[2]=0,a[3]=t,a[4]=0,a[5]=0}scale(o,t){const a=this.matrix;a[0]*=o,a[1]*=o,a[2]*=t,a[3]*=t}setToRotation(o){const t=this.matrix;let a=Math.cos(o),s=Math.sin(o);(a===-1||a===1)&&(s=0),(s===-1||s===1)&&(a=0),t[0]=a,t[1]=s,t[2]=-s,t[3]=a,t[4]=0,t[5]=0}rotate(o){const t=this.matrix;let a=Math.cos(o),s=Math.sin(o);(a===-1||a===1)&&(s=0),(s===-1||s===1)&&(a=0);const i=t[0],n=t[1],m=t[2],r=t[3];t[0]=i*a+m*s,t[1]=n*a+r*s,t[2]=i*-s+m*a,t[3]=n*-s+r*a}setToRotationAround(o,t,a){const s=this.matrix;let i=Math.cos(o),n=Math.sin(o);(i===-1||i===1)&&(n=0),(n===-1||n===1)&&(i=0),s[0]=i,s[1]=n,s[2]=-n,s[3]=i,s[4]=t-t*i+a*n,s[5]=a-t*n+a*i}rotateAround(o,t,a){this.translate(t,a),this.rotate(o),this.translate(-t,-a)}setToFlipX(o){const t=this.matrix;t[0]=-1,t[1]=0,t[2]=0,t[3]=1,t[4]=2*o,t[5]=0}flipX(o){this.translate(o,0),this.scale(-1,1),this.translate(-o,0)}setToFlipY(o){const t=this.matrix;t[0]=-1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=2*o}flipY(o){this.translate(0,o),this.scale(1,-1),this.translate(0,-o)}concatenate(o){const t=this.matrix,a=o.matrix,s=t[0],i=t[1],n=t[2],m=t[3],r=t[4],h=t[5],l=a[0],e=a[1],x=a[2],f=a[3],u=a[4],T=a[5];t[0]=l*s+e*n,t[1]=l*i+e*m,t[2]=x*s+f*n,t[3]=x*i+f*m,t[4]=u*s+T*n+r,t[5]=u*i+T*m+h}preConcatenate(o){const t=this.matrix,a=o.matrix,s=t[0],i=t[1],n=t[2],m=t[3],r=t[4],h=t[5],l=a[0],e=a[1],x=a[2],f=a[3],u=a[4],T=a[5];t[0]=s*l+i*x,t[1]=s*e+i*f,t[2]=n*l+m*x,t[3]=n*e+m*f,t[4]=r*l+h*x+u,t[5]=r*e+h*f+T}transform(o,t){const a=this.matrix,s=a[0]*o[0]+a[2]*o[1]+a[4],i=a[1]*o[0]+a[3]*o[1]+a[5];t[0]=s,t[1]=i}invert(){const o=this.matrix,t=o[0],a=o[1],s=o[2],i=o[3],n=o[4],m=o[5],r=t*i-a*s;return o[0]=i/r,o[1]=-a/r,o[2]=-s/r,o[3]=t/r,o[4]=(s*m-i*n)/r,o[5]=-(t*m-a*n)/r,this}toString(){const o=this.matrix;return`[[${o[0]} ${o[1]}] [${o[2]} ${o[3]}] [${o[4]} ${o[5]}]]`}}c.AffineTransformation=y})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=affinetransformation.js.map
code0.js ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ gdjs.MainCode = {};
2
+ gdjs.MainCode.localVariables = [];
3
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1= [];
4
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects2= [];
5
+ gdjs.MainCode.GDInstructionObjects1= [];
6
+ gdjs.MainCode.GDInstructionObjects2= [];
7
+ gdjs.MainCode.GDStartButtonObjects1= [];
8
+ gdjs.MainCode.GDStartButtonObjects2= [];
9
+
10
+
11
+ gdjs.MainCode.mapOfGDgdjs_9546MainCode_9546GDStartButtonObjects1Objects = Hashtable.newFrom({"StartButton": gdjs.MainCode.GDStartButtonObjects1});
12
+ gdjs.MainCode.eventsList0 = function(runtimeScene) {
13
+
14
+ {
15
+
16
+
17
+ let isConditionTrue_0 = false;
18
+ isConditionTrue_0 = false;
19
+ isConditionTrue_0 = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene);
20
+ if (isConditionTrue_0) {
21
+ gdjs.copyArray(runtimeScene.getObjects("VoiceRecognitionStatusText"), gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1);
22
+ {gdjs.evtsExt__VoiceRecognition__StartListening.func(runtimeScene, "en-US (English)", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined));
23
+ }{for(var i = 0, len = gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1.length ;i < len;++i) {
24
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1[i].setString(gdjs.evtsExt__VoiceRecognition__RetrieveStatus.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)));
25
+ }
26
+ }}
27
+
28
+ }
29
+
30
+
31
+ {
32
+
33
+ gdjs.copyArray(runtimeScene.getObjects("StartButton"), gdjs.MainCode.GDStartButtonObjects1);
34
+
35
+ let isConditionTrue_0 = false;
36
+ isConditionTrue_0 = false;
37
+ isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.MainCode.mapOfGDgdjs_9546MainCode_9546GDStartButtonObjects1Objects, runtimeScene, true, false);
38
+ if (isConditionTrue_0) {
39
+ isConditionTrue_0 = false;
40
+ isConditionTrue_0 = gdjs.evtTools.input.isMouseButtonReleased(runtimeScene, "Left");
41
+ }
42
+ if (isConditionTrue_0) {
43
+ gdjs.copyArray(runtimeScene.getObjects("VoiceRecognitionStatusText"), gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1);
44
+ {gdjs.evtsExt__VoiceRecognition__StartListening.func(runtimeScene, "en-US (English)", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined));
45
+ }{for(var i = 0, len = gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1.length ;i < len;++i) {
46
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1[i].setString(gdjs.evtsExt__VoiceRecognition__RetrieveStatus.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)));
47
+ }
48
+ }}
49
+
50
+ }
51
+
52
+
53
+ {
54
+
55
+
56
+ let isConditionTrue_0 = false;
57
+ isConditionTrue_0 = false;
58
+ isConditionTrue_0 = gdjs.evtsExt__VoiceRecognition__OnError.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined));
59
+ if (isConditionTrue_0) {
60
+ gdjs.copyArray(runtimeScene.getObjects("VoiceRecognitionStatusText"), gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1);
61
+ {for(var i = 0, len = gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1.length ;i < len;++i) {
62
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1[i].setString(gdjs.evtsExt__VoiceRecognition__RetrieveError.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)));
63
+ }
64
+ }}
65
+
66
+ }
67
+
68
+
69
+ {
70
+
71
+
72
+ let isConditionTrue_0 = false;
73
+ isConditionTrue_0 = false;
74
+ isConditionTrue_0 = gdjs.evtsExt__VoiceRecognition__OnSuccess.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined));
75
+ if (isConditionTrue_0) {
76
+ gdjs.copyArray(runtimeScene.getObjects("VoiceRecognitionStatusText"), gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1);
77
+ {for(var i = 0, len = gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1.length ;i < len;++i) {
78
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1[i].setString(gdjs.evtsExt__VoiceRecognition__RetrievetResultText.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)));
79
+ }
80
+ }}
81
+
82
+ }
83
+
84
+
85
+ };
86
+
87
+ gdjs.MainCode.func = function(runtimeScene) {
88
+ runtimeScene.getOnceTriggers().startNewFrame();
89
+
90
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1.length = 0;
91
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects2.length = 0;
92
+ gdjs.MainCode.GDInstructionObjects1.length = 0;
93
+ gdjs.MainCode.GDInstructionObjects2.length = 0;
94
+ gdjs.MainCode.GDStartButtonObjects1.length = 0;
95
+ gdjs.MainCode.GDStartButtonObjects2.length = 0;
96
+
97
+ gdjs.MainCode.eventsList0(runtimeScene);
98
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects1.length = 0;
99
+ gdjs.MainCode.GDVoiceRecognitionStatusTextObjects2.length = 0;
100
+ gdjs.MainCode.GDInstructionObjects1.length = 0;
101
+ gdjs.MainCode.GDInstructionObjects2.length = 0;
102
+ gdjs.MainCode.GDStartButtonObjects1.length = 0;
103
+ gdjs.MainCode.GDStartButtonObjects2.length = 0;
104
+
105
+
106
+ return;
107
+
108
+ }
109
+
110
+ gdjs['MainCode'] = gdjs.MainCode;
data.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gdjs.projectData = {"firstLayout":"","gdVersion":{"build":222,"major":5,"minor":5,"revision":0},"properties":{"adaptGameResolutionAtRuntime":true,"antialiasingMode":"MSAA","antialisingEnabledOnMobile":false,"folderProject":false,"orientation":"landscape","packageName":"com.planktonfun.voicerecognition","pixelsRounding":false,"projectUuid":"8be9daf9-aad4-4e13-b1c9-b1cf726df436","scaleMode":"linear","sizeOnStartupMode":"","templateSlug":"voice-recognition","version":"1.0.0","name":"Fresh Winter (Voice recognition)","description":"A demo for using voice recognition in gdevelop, useful for a developer looking to make voice based games/apps.","author":"","windowWidth":800,"windowHeight":600,"latestCompilationDirectory":"","maxFPS":60,"minFPS":20,"verticalSync":false,"platformSpecificAssets":{},"loadingScreen":{"backgroundColor":0,"backgroundFadeInDuration":0.2,"backgroundImageResourceName":"","gdevelopLogoStyle":"light","logoAndProgressFadeInDuration":0.2,"logoAndProgressLogoFadeInDelay":0.2,"minDuration":1.5,"progressBarColor":16777215,"progressBarHeight":20.0,"progressBarMaxWidth":200.0,"progressBarMinWidth":40.0,"progressBarWidthPercent":30.0,"showGDevelopSplash":true,"showProgressBar":true},"watermark":{"placement":"bottom-left","showWatermark":true},"authorIds":["J37o8O1JKTNpANl1quUtIZLXAll1"],"authorUsernames":[],"categories":[],"playableDevices":[],"extensionProperties":[],"platforms":[{"name":"GDevelop JS platform"}],"currentPlatform":"GDevelop JS platform"},"resources":{"resources":[{"file":"Start button.png","kind":"image","metadata":"","name":"Start button.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://resources.gdevelop-app.com/assets/On-Screen Controls/Sprites/Flat Dark/Start button.png","name":"gdevelop-asset-store"}}],"resourceFolders":[]},"objects":[],"objectsFolderStructure":{"folderName":"__ROOT"},"objectsGroups":[],"variables":[],"layouts":[{"b":209,"disableInputWhenNotFocused":true,"mangledName":"Main","name":"Main","r":209,"standardSortMethod":true,"stopSoundsOnStartup":true,"title":"","v":209,"uiSettings":{"grid":false,"gridType":"rectangular","gridWidth":32.0,"gridHeight":32.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"gridColor":10401023.0,"gridAlpha":0.8,"snap":false,"zoomFactor":0.8399999999999999,"windowMask":false},"objectsGroups":[],"variables":[],"instances":[{"angle":0.0,"customSize":true,"height":96.0,"layer":"","name":"VoiceRecognitionStatusText","persistentUuid":"54a9cf18-3d55-4ac7-969a-5f4c8f876b98","width":324.0,"x":257.0,"y":234.0,"zOrder":3,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"Instruction","persistentUuid":"33c34643-ddcc-4c89-9704-76c8ec96d7df","width":0.0,"x":22.0,"y":38.0,"zOrder":4,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"StartButton","persistentUuid":"74224143-b28c-4a12-802b-58d28c13cf95","width":0.0,"x":343.0,"y":378.0,"zOrder":5,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"objects":[{"assetStoreId":"","bold":false,"italic":false,"name":"VoiceRecognitionStatusText","smoothed":true,"type":"TextObject::Text","underlined":false,"variables":[{"folded":true,"name":"text","type":"string","value":"hello there, please press space to start"}],"effects":[],"behaviors":[{"name":"Effect","type":"EffectCapability::EffectBehavior"},{"name":"Opacity","type":"OpacityCapability::OpacityBehavior"},{"name":"Scale","type":"ScalableCapability::ScalableBehavior"},{"name":"Text","type":"TextContainerCapability::TextContainerBehavior"}],"string":"to start listening press start","font":"","textAlignment":"","characterSize":20.0,"color":{"b":0,"g":0,"r":0},"content":{"bold":false,"isOutlineEnabled":false,"isShadowEnabled":false,"italic":false,"outlineColor":"255;255;255","outlineThickness":2.0,"shadowAngle":90.0,"shadowBlurRadius":2.0,"shadowColor":"0;0;0","shadowDistance":4.0,"shadowOpacity":127.0,"smoothed":true,"underlined":false,"text":"to start listening press start","font":"","textAlignment":"","verticalTextAlignment":"top","characterSize":20.0,"color":"0;0;0"}},{"assetStoreId":"","bold":false,"italic":false,"name":"Instruction","smoothed":true,"type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[{"name":"Effect","type":"EffectCapability::EffectBehavior"},{"name":"Opacity","type":"OpacityCapability::OpacityBehavior"},{"name":"Scale","type":"ScalableCapability::ScalableBehavior"},{"name":"Text","type":"TextContainerCapability::TextContainerBehavior"}],"string":"Caveats: Voice recognition is only supported in https for security\nInstruction: To test this click publish -> generate link -> open the link","font":"","textAlignment":"","characterSize":20.0,"color":{"b":0,"g":0,"r":0},"content":{"bold":false,"isOutlineEnabled":false,"isShadowEnabled":false,"italic":false,"outlineColor":"255;255;255","outlineThickness":2.0,"shadowAngle":90.0,"shadowBlurRadius":2.0,"shadowColor":"0;0;0","shadowDistance":4.0,"shadowOpacity":127.0,"smoothed":true,"underlined":false,"text":"Caveats: Voice recognition is only supported in https for security\nInstruction: To test this click publish -> generate link -> open the link","font":"","textAlignment":"","verticalTextAlignment":"top","characterSize":20.0,"color":"0;0;0"}},{"adaptCollisionMaskAutomatically":false,"assetStoreId":"a5f25aefb989f5bf860c66e9cbdee237e4bcf7abb62a312d3fb46646352edb70","name":"StartButton","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"Animation","type":"AnimatableCapability::AnimatableBehavior"},{"name":"Effect","type":"EffectCapability::EffectBehavior"},{"name":"Flippable","type":"FlippableCapability::FlippableBehavior"},{"name":"Opacity","type":"OpacityCapability::OpacityBehavior"},{"name":"Resizable","type":"ResizableCapability::ResizableBehavior"},{"name":"Scale","type":"ScalableCapability::ScalableBehavior"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.02500000037252903,"sprites":[{"hasCustomCollisionMask":false,"image":"Start button.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]}],"objectsFolderStructure":{"folderName":"__ROOT"},"events":[],"layers":[{"ambientLightColorB":32,"ambientLightColorG":0,"ambientLightColorR":0,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"cameraType":"perspective","followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"","renderingType":"","visibility":true,"cameras":[{"defaultSize":true,"defaultViewport":true,"height":0.0,"viewportBottom":1.0,"viewportLeft":0.0,"viewportRight":1.0,"viewportTop":0.0,"width":0.0}],"effects":[]}],"behaviorsSharedData":[],"usedResources":[{"name":"Start button.png"}]}],"externalEvents":[],"eventsFunctionsExtensions":[],"externalLayouts":[],"usedResources":[]};
2
+ gdjs.runtimeGameOptions = {};
events-tools/cameratools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(L){let I;(function(d){let b;(function(r){r.setCameraX=function(t,e,n,s){!t.hasLayer(n)||t.getLayer(n).setCameraX(e,s)},r.setCameraY=function(t,e,n,s){!t.hasLayer(n)||t.getLayer(n).setCameraY(e,s)},r.getCameraX=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraX():0},r.getCameraY=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraY():0},r.getCameraWidth=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraWidth():0},r.getCameraHeight=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraHeight():0},r.getCameraBorderLeft=function(t,e,n){return t.hasLayer(e)?r.getCameraX(t,e,n)-r.getCameraWidth(t,e,n)/2:0},r.getCameraBorderRight=function(t,e,n){return t.hasLayer(e)?r.getCameraX(t,e,n)+r.getCameraWidth(t,e,n)/2:0},r.getCameraBorderTop=function(t,e,n){return t.hasLayer(e)?r.getCameraY(t,e,n)-r.getCameraHeight(t,e,n)/2:0},r.getCameraBorderBottom=function(t,e,n){return t.hasLayer(e)?r.getCameraY(t,e,n)+r.getCameraHeight(t,e,n)/2:0},r.showLayer=function(t,e){if(!!t.hasLayer(e))return t.getLayer(e).show(!0)},r.hideLayer=function(t,e){if(!!t.hasLayer(e))return t.getLayer(e).show(!1)},r.layerIsVisible=function(t,e){return t.hasLayer(e)&&t.getLayer(e).isVisible()},r.setCameraRotation=function(t,e,n,s){if(!!t.hasLayer(n))return t.getLayer(n).setCameraRotation(e,s)},r.getCameraRotation=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraRotation(n):0},r.getCameraZoom=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraZoom(n):0},r.setCameraZoom=function(t,e,n,s){if(!!t.hasLayer(n))return t.getLayer(n).setCameraZoom(e,s)},r.centerCamera=function(t,e,n,s,o){if(!t.hasLayer(s)||e==null)return;let f=0,i=0;if(n&&!e.hasNoForces()){const u=e.getAverageForce(),a=e.getElapsedTime(t)/1e3;f=u.getX()*a,i=u.getY()*a}const g=t.getLayer(s);g.setCameraX(e.getCenterXInScene()+f,o),g.setCameraY(e.getCenterYInScene()+i,o)},r.centerCameraWithinLimits=function(t,e,n,s,o,f,i,g,u){r.centerCamera(t,e,i,g,u),r.clampCamera(t,n,s,o,f,g,u)},r.clampCamera=function(t,e,n,s,o,f,i){if(!t.hasLayer(f))return;const g=t.getLayer(f),u=g.getCameraWidth(i)/2,a=g.getCameraHeight(i)/2,m=e+u,c=s-u,h=n+a,p=o-a,E=m<c?L.evtTools.common.clamp(g.getCameraX(i),m,c):(m+c)/2,B=h<p?L.evtTools.common.clamp(g.getCameraY(i),h,p):(h+p)/2;g.setCameraX(E,i),g.setCameraY(B,i)},r.setLayerEffectDoubleParameter=function(t,e,n,s,o){if(!!t.hasLayer(e))return t.getLayer(e).setEffectDoubleParameter(n,s,o)},r.setLayerEffectStringParameter=function(t,e,n,s,o){if(!!t.hasLayer(e))return t.getLayer(e).setEffectStringParameter(n,s,o)},r.setLayerEffectBooleanParameter=function(t,e,n,s,o){if(!!t.hasLayer(e))return t.getLayer(e).setEffectBooleanParameter(n,s,o)},r.enableLayerEffect=function(t,e,n,s){!t.hasLayer(e)||t.getLayer(e).enableEffect(n,s)},r.layerEffectEnabled=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).isEffectEnabled(n):!0},r.setLayerTimeScale=function(t,e,n){if(!!t.hasLayer(e))return t.getLayer(e).setTimeScale(n)},r.getLayerTimeScale=function(t,e){return t.hasLayer(e)?t.getLayer(e).getTimeScale():1},r.setLayerDefaultZOrder=function(t,e,n){if(!!t.hasLayer(e))return t.getLayer(e).setDefaultZOrder(n)},r.getLayerDefaultZOrder=function(t,e){return t.hasLayer(e)?t.getLayer(e).getDefaultZOrder():0},r.setLayerAmbientLightColor=function(t,e,n){if(!t.hasLayer(e)||!t.getLayer(e).isLightingLayer())return;const s=n.split(";");if(!(s.length<3))return t.getLayer(e).setClearColor(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10))}})(b=d.camera||(d.camera={}))})(I=L.evtTools||(L.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=cameratools.js.map
events-tools/commontools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(o){let s;(function(u){let p;(function(n){n.toNumber=function(t){return parseFloat(t)},n.toString=function(t){return""+t},n.logicalNegation=function(t){return!t},n.normalize=function(t,e,r){return e===r?r:(t-e)/(r-e)},n.clamp=function(t,e,r){return Math.min(Math.max(t,e),r)},n.acosh=function(t){return Math.log(t+Math.sqrt(t*t-1))},n.asinh=function(t){return Math.log(t+Math.sqrt(t*t+1))},n.atanh=function(t){return .5*Math.log((1+t)/(1-t))},n.cosh=function(t){return(Math.exp(t)+Math.exp(-t))/2},n.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2},n.tanh=function(t){return(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))},n.cot=function(t){return 1/Math.tan(t)},n.csc=function(t){return 1/Math.sin(t)},n.sec=function(t){return 1/Math.cos(t)},n.log10=function(t){return Math.log(t)/Math.LN10},n.log2=function(t){return Math.log(t)/Math.LN2},n.sign=function(t){return t===0?0:t>0?1:-1},n.cbrt=function(t){return Math.pow(t,1/3)},n.nthroot=function(t,e){return Math.pow(t,1/e)},n.mod=function(t,e){return t-e*Math.floor(t/e)},n.angleDifference=function(t,e){return o.evtTools.common.mod(o.evtTools.common.mod(t-e,360)+180,360)-180},n.angleBetweenPositions=function(t,e,r,i){return Math.atan2(i-e,r-t)*180/Math.PI},n.distanceBetweenPositions=function(t,e,r,i){return Math.sqrt((t-r)*(t-r)+(e-i)*(e-i))},n.lerp=function(t,e,r){return t+(e-t)*r},n.exponentialInterpolation=(t,e,r)=>{if(r===0)return t;if(r===1)return e;if(t<=0||e<=0)return 0;const i=Math.log(t),l=Math.log(e);return Math.exp(i+(l-i)*r)},n.trunc=function(t){return t|0},n.getXFromAngleAndDistance=function(t,e){return e*Math.cos(o.toRad(t))},n.getYFromAngleAndDistance=function(t,e){return e*Math.sin(o.toRad(t))},n.roundTo=function(t,e){return!e||!Number.isInteger(e)?Math.round(t):Math.round(t*Math.pow(10,e))/Math.pow(10,e)},n.floorTo=function(t,e){return!e||!Number.isInteger(e)?Math.floor(t):Math.floor(t*Math.pow(10,e))/Math.pow(10,e)},n.ceilTo=function(t,e){return!e||!Number.isInteger(e)?Math.ceil(t):Math.ceil(t*Math.pow(10,e))/Math.pow(10,e)},n.pi=function(){return Math.PI},n.lerpAngle=function(t,e,r){return t+o.evtTools.common.angleDifference(e,t)*r},n.resolveAsyncEventsFunction=t=>{!!t&&!!t.task&&!!t.task.resolve&&t.task.resolve()};const c=()=>{if(typeof cc!="undefined"&&cc.sys)return cc.sys.isMobile;if(typeof Cocoon!="undefined"&&Cocoon.App)return!0;if(typeof window!="undefined"&&window.cordova)return!0;if(typeof window!="undefined"){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))||/iPad|iPhone|iPod/.test(navigator.platform))return!0;if(/MacIntel/.test(navigator.platform))return!!navigator.maxTouchPoints&&navigator.maxTouchPoints>2}return!1};let a=null;n.isMobile=()=>a!==null?a:a=c()})(p=u.common||(u.common={}))})(s=o.evtTools||(o.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=commontools.js.map
events-tools/inputtools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(o){let i;(function(c){let d;(function(n){n.lastTouchId=0,n.lastEndedTouchId=0,n.keysNameToCode={a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,Num0:48,Num1:49,Num2:50,Num3:51,Num4:52,Num5:53,Num6:54,Num7:55,Num8:56,Num9:57,Numpad0:96,Numpad1:97,Numpad2:98,Numpad3:99,Numpad4:100,Numpad5:101,Numpad6:102,Numpad7:103,Numpad8:104,Numpad9:105,LShift:1016,RShift:2016,LControl:1017,RControl:2017,LAlt:1018,RAlt:2018,LSystem:1091,RSystem:2091,SemiColon:186,Comma:188,Period:190,Quote:222,Slash:191,BackSlash:220,Equal:187,Dash:189,Menu:93,LBracket:219,RBracket:221,Tilde:192,Space:32,Back:8,Tab:9,Delete:46,Insert:45,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Return:13,NumpadPageUp:3033,NumpadPageDown:3034,NumpadEnd:3035,NumpadHome:3036,NumpadReturn:3013,Add:107,Subtract:109,Multiply:106,Divide:111,NumpadAdd:3107,NumpadSubtract:3109,NumpadMultiply:3106,NumpadDivide:3111,Left:37,Up:38,Right:39,Down:40,NumpadLeft:3037,NumpadUp:3038,NumpadRight:3039,NumpadDown:3040,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,Pause:19};const u={};for(const e in n.keysNameToCode)n.keysNameToCode.hasOwnProperty(e)&&(u[n.keysNameToCode[e]]=e);n.mouseButtonsNameToCode={Left:o.InputManager.MOUSE_LEFT_BUTTON,Right:o.InputManager.MOUSE_RIGHT_BUTTON,Middle:o.InputManager.MOUSE_MIDDLE_BUTTON,Back:o.InputManager.MOUSE_BACK_BUTTON,Forward:o.InputManager.MOUSE_FORWARD_BUTTON},n.isKeyPressed=function(e,t){return o.evtTools.input.keysNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().isKeyPressed(o.evtTools.input.keysNameToCode[t]):!1},n.wasKeyReleased=function(e,t){return o.evtTools.input.keysNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().wasKeyReleased(o.evtTools.input.keysNameToCode[t]):!1},n.lastPressedKey=function(e){const t=e.getGame().getInputManager().getLastPressedKey();return u.hasOwnProperty(t)?u[t]:""},n.anyKeyPressed=function(e){return e.getGame().getInputManager().anyKeyPressed()},n.anyKeyReleased=function(e){return e.getGame().getInputManager().anyKeyReleased()},n.isMouseButtonPressed=function(e,t){return o.evtTools.input.mouseButtonsNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().isMouseButtonPressed(o.evtTools.input.mouseButtonsNameToCode[t]):!1},n.isMouseButtonReleased=function(e,t){return o.evtTools.input.mouseButtonsNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().isMouseButtonReleased(o.evtTools.input.mouseButtonsNameToCode[t]):!1},n.hideCursor=function(e){e.getScene().getRenderer().hideCursor()},n.showCursor=function(e){e.getScene().getRenderer().showCursor()},n.getMouseWheelDelta=function(e){return e.getGame().getInputManager().getMouseWheelDelta()},n.isScrollingUp=function(e){return e.getGame().getInputManager().isScrollingUp()},n.isScrollingDown=function(e){return e.getGame().getInputManager().isScrollingDown()},n.getMouseX=function(e,t,r){return n.getCursorX(e,t,r)},n.getMouseY=function(e,t,r){return n.getCursorY(e,t,r)},n.getCursorX=function(e,t,r){const a=o.staticArray(o.evtTools.input.getCursorX);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getCursorX(),e.getGame().getInputManager().getCursorY(),0,a)[0]},n.getCursorY=function(e,t,r){const a=o.staticArray(o.evtTools.input.getCursorY);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getCursorX(),e.getGame().getInputManager().getCursorY(),0,a)[1]},n.getMouseOnlyCursorX=function(e,t,r){const a=o.staticArray(o.evtTools.input.getMouseOnlyCursorX);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getMouseX(),e.getGame().getInputManager().getMouseY(),0,a)[0]},n.getMouseOnlyCursorY=function(e,t,r){const a=o.staticArray(o.evtTools.input.getMouseOnlyCursorY);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getMouseX(),e.getGame().getInputManager().getMouseY(),0,a)[1]},n.isMouseInsideCanvas=function(e){return e.getGame().getInputManager().isMouseInsideCanvas()};const I=function(e,t){return e.cursorOnObject(t)};n.cursorOnObject=function(e,t,r,a){return o.evtTools.object.pickObjectsIf(I,e,a,t)},n.getTouchX=function(e,t,r,a){const g=o.staticArray(o.evtTools.input.getTouchX);return e.getLayer(r).convertCoords(e.getGame().getInputManager().getTouchX(t),e.getGame().getInputManager().getTouchY(t),0,g)[0]},n.getTouchY=(e,t,r,a)=>{const g=o.staticArray(o.evtTools.input.getTouchY);return e.getLayer(r).convertCoords(e.getGame().getInputManager().getTouchX(t),e.getGame().getInputManager().getTouchY(t),0,g)[1]},n.hasAnyTouchStarted=e=>{const t=e.getGame().getInputManager().getStartedTouchIdentifiers();return t.length>1||t.length>0&&t[0]!==o.InputManager.MOUSE_TOUCH_ID},n.getStartedTouchCount=e=>{const t=e.getGame().getInputManager().getStartedTouchIdentifiers();return t.length+(t.includes(o.InputManager.MOUSE_TOUCH_ID)?-1:0)},n.getStartedTouchIdentifier=(e,t)=>{const r=e.getGame().getInputManager().getStartedTouchIdentifiers(),a=r.indexOf(o.InputManager.MOUSE_TOUCH_ID);return a<0?r[t]:r[t<a?t:t+1]},n.hasAnyTouchOrMouseStarted=e=>e.getGame().getInputManager().getStartedTouchIdentifiers().length>0,n.getStartedTouchOrMouseCount=e=>e.getGame().getInputManager().getStartedTouchIdentifiers().length,n.getStartedTouchOrMouseIdentifier=(e,t)=>e.getGame().getInputManager().getStartedTouchIdentifiers()[t]||0,n.hasTouchEnded=(e,t)=>e.getGame().getInputManager().hasTouchEnded(t),n.getLastTouchId=function(){return o.evtTools.input.lastTouchId||0},n.getLastEndedTouchId=function(){return o.evtTools.input.lastEndedTouchId||0},n.popStartedTouch=function(e){const t=e.getGame().getInputManager().popStartedTouch();return t!==void 0?(o.evtTools.input.lastTouchId=t,!0):!1},n.popEndedTouch=function(e){const t=e.getGame().getInputManager().popEndedTouch();return t!==void 0?(o.evtTools.input.lastEndedTouchId=t,!0):!1},n.touchSimulateMouse=function(e,t){e.getGame().getInputManager().touchSimulateMouse(t)}})(d=c.input||(c.input={}))})(i=o.evtTools||(o.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=inputtools.js.map
events-tools/networktools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(u){let p;(function(g){let d;(function(r){r.sendAsyncRequest=function(n,s,i,o,c,a){const e=t=>{t instanceof ProgressEvent&&t.currentTarget&&t.currentTarget instanceof XMLHttpRequest&&t.currentTarget.status===0?a.setString("REQUEST_NOT_SENT"):a.setString(""+t)};try{const t=new XMLHttpRequest;t.onerror=e,t.ontimeout=e,t.onabort=e,t.onreadystatechange=()=>{t.readyState===4&&(t.status>=400&&e(""+t.status),c.setString(t.responseText))},t.open(i,n),t.setRequestHeader("Content-Type",o===""?"application/x-www-form-urlencoded":o),t.send(s)}catch(t){e(t)}},r.sendAwaitableAsyncRequest=(n,s,i,o,c,a)=>new u.PromiseTask(fetch(n,{body:i!=="GET"?s:void 0,method:i,headers:{"Content-Type":o||"application/x-www-form-urlencoded"}}).then(async e=>{const t=await e.text();e.status>=400&&a.setString(""+e.status),c.setString(t)},e=>{a.setString(""+e)})),r.sendDeprecatedSynchronousRequest=function(n,s,i,o,c,a){try{let e;if(typeof XMLHttpRequest!="undefined")e=new XMLHttpRequest;else{const t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];for(let l=0,b=t.length;l<b;l++)try{e=new ActiveXObject(t[l]);break}catch{}}if(e===void 0)return;e.open(o,n+s,!1),e.setRequestHeader("Content-Type",c===""?"application/x-www-form-urlencoded":c),e.send(i),a.setString(e.responseText)}catch{}},r.enableMetrics=function(n,s){n.getGame().enableMetrics(s)},r.variableStructureToJSON=function(n){return JSON.stringify(n.toJSObject())},r.objectVariableStructureToJSON=function(n,s){return JSON.stringify(s.toJSObject())},r._objectToVariable=function(n,s){s.fromJSObject(n)},r.jsonToVariableStructure=function(n,s){s.fromJSON(n)},r.jsonToObjectVariableStructure=function(n,s,i){i.fromJSON(n)}})(d=g.network||(g.network={}))})(p=u.evtTools||(u.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=networktools.js.map
events-tools/objecttools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(o){let y;(function(O){let w;(function(g){g.pickOnly=function(e,t){for(const s in e.items)if(e.items.hasOwnProperty(s)){const n=e.items[s];n.indexOf(t)===-1?n.length=0:(n.length=0,n.push(t))}},g.twoListsTest=function(e,t,s,n,i){let f=!1;const r=o.staticArray(o.evtTools.object.twoListsTest);t.values(r);const u=o.staticArray2(o.evtTools.object.twoListsTest);s.values(u);for(let a=0,j=r.length;a<j;++a){let c=r[a];for(let l=0,b=c.length;l<b;++l)c[l].pick=!1}for(let a=0,j=u.length;a<j;++a){let c=u[a];for(let l=0,b=c.length;l<b;++l)c[l].pick=!1}for(let a=0,j=r.length;a<j;++a){const c=r[a];for(let l=0,b=c.length;l<b;++l){let d=!1;for(let T=0,L=u.length;T<L;++T){const k=u[T];for(let p=0,R=k.length;p<R;++p)c[l].pick&&k[p].pick||c[l].id!==k[p].id&&e(c[l],k[p],i)&&(n||(f=!0,c[l].pick=!0,k[p].pick=!0),d=!0)}!d&&n&&(f=!0,c[l].pick=!0)}}for(let a=0,j=r.length;a<j;++a){let c=r[a],l=0;for(let b=0,d=c.length;b<d;++b){let T=c[b];c[b].pick&&(c[l]=T,l++)}c.length=l}if(!n)for(let a=0,j=u.length;a<j;++a){let c=u[a],l=0;for(let b=0,d=c.length;b<d;++b){let T=c[b];c[b].pick&&(c[l]=T,l++)}c.length=l}return f},g.pickObjectsIf=function(e,t,s,n){let i=!1;const f=o.staticArray(o.evtTools.object.pickObjectsIf);t.values(f);for(let r=0,u=f.length;r<u;++r){const a=f[r];for(let j=0,c=a.length;j<c;++j){const l=a[j];s^e(l,n)?(i=!0,l.pick=!0):l.pick=!1}}for(let r=0,u=f.length;r<u;++r)o.evtTools.object.filterPickedObjectsList(f[r]);return i},g.filterPickedObjectsList=function(e){let t=0;for(let s=0,n=e.length;s<n;++s){const i=e[s];i.pick&&(e[t]=i,t++)}e.length=t},g.hitBoxesCollisionTest=function(e,t,s,n,i){return o.evtTools.object.twoListsTest(o.RuntimeObject.collisionTest,e,t,s,i)},g._distanceBetweenObjects=function(e,t,s){return e.getSqDistanceToObject(t)<=s},g.distanceTest=function(e,t,s,n){return o.evtTools.object.twoListsTest(o.evtTools.object._distanceBetweenObjects,e,t,n,s*s)},g._movesToward=function(e,t,s){if(e.hasNoForces())return!1;let n=Math.atan2(t.getDrawableY()+t.getCenterY()-(e.getDrawableY()+e.getCenterY()),t.getDrawableX()+t.getCenterX()-(e.getDrawableX()+e.getCenterX()));return n*=180/3.14159,Math.abs(o.evtTools.common.angleDifference(e.getAverageForce().getAngle(),n))<=s/2},g.movesTowardTest=function(e,t,s,n){return o.evtTools.object.twoListsTest(o.evtTools.object._movesToward,e,t,n,s)},g._turnedToward=function(e,t,s){let n=Math.atan2(t.getDrawableY()+t.getCenterY()-(e.getDrawableY()+e.getCenterY()),t.getDrawableX()+t.getCenterX()-(e.getDrawableX()+e.getCenterX()));return n*=180/3.14159,Math.abs(o.evtTools.common.angleDifference(e.getAngle(),n))<=s/2},g.turnedTowardTest=function(e,t,s,n){return o.evtTools.object.twoListsTest(o.evtTools.object._turnedToward,e,t,n,s)},g._isTurnedTowardObject=function(e,t,s){return Math.abs(o.evtTools.common.angleDifference(e.getAngle(),e.getAngleToObject(t)))<=s},g.isTurnedTowardObject=function(e,t,s,n){return o.evtTools.object.twoListsTest(o.evtTools.object._isTurnedTowardObject,e,t,n,s)},g.pickAllObjects=function(e,t){for(const s in t.items)if(t.items.hasOwnProperty(s)){const n=e.getObjects(s),i=t.items[s];i.length=0,i.push.apply(i,n)}return!0},g.pickRandomObject=function(e,t){let s=0;for(let r in t.items)t.items.hasOwnProperty(r)&&(s+=t.items[r].length);if(s===0)return!1;let n=Math.floor(Math.random()*s);n>=s&&(n=s-1);let i=0,f=null;for(let r in t.items)if(t.items.hasOwnProperty(r)){let u=t.items[r];if(n-i<u.length){f=u[n-i];break}i+=u.length}return o.evtTools.object.pickOnly(t,f),!0},g.pickNearestObject=function(e,t,s,n){let i=null,f=0,r=!0;const u=o.staticArray(o.evtTools.object.pickNearestObject);e.values(u);for(let a=0,j=u.length;a<j;++a){const c=u[a];for(let l=0;l<c.length;++l){const b=c[l],d=b.getSqDistanceToPosition(t,s);(r||d<f^n)&&(f=d,i=b),r=!1}}return i?(o.evtTools.object.pickOnly(e,i),!0):!1},g.raycastObject=function(e,t,s,n,i,f,r,u){return o.evtTools.object.raycastObjectToPosition(e,t,s,t+i*Math.cos(n*Math.PI/180),s+i*Math.sin(n*Math.PI/180),f,r,u)},g.raycastObjectToPosition=function(e,t,s,n,i,f,r,u){let a=null,j=u?0:(n-t)*(n-t)+(i-s)*(i-s),c=0,l=0;const b=o.staticArray(o.evtTools.object.raycastObjectToPosition);e.values(b);for(let d=0;d<b.length;d++){const T=b[d];for(let L=0;L<T.length;L++){const k=T[L],p=k.raycastTest(t,s,n,i,!u);p.collision&&(!u&&p.closeSqDist<=j?(j=p.closeSqDist,a=k,c=p.closeX,l=p.closeY):u&&p.farSqDist>=j&&(j=p.farSqDist,a=k,c=p.farX,l=p.farY))}}return a?(o.evtTools.object.pickOnly(e,a),f.setNumber(c),r.setNumber(l),!0):!1},g.doCreateObjectOnScene=function(e,t,s,n,i,f){const r=e.createObject(t),u=e.getLayer(f);return r!==null&&(r.setPosition(n,i),r.setLayer(f),r.setZOrder(u.getDefaultZOrder()),s.containsKey(t)&&s.get(t).push(r)),r},g.createObjectOnScene=function(e,t,s,n,i){return o.evtTools.object.doCreateObjectOnScene(e,t.firstKey(),t,s,n,i)},g.createObjectFromGroupOnScene=function(e,t,s,n,i,f){o.evtTools.object.doCreateObjectOnScene(e,s,t,n,i,f)},g.getPickedInstancesCount=e=>{let t=0;const s=o.staticArray(o.evtTools.object.getPickedInstancesCount);e.values(s);for(let n=0,i=s.length;n<i;++n)t+=s[n].length;return t},g.getSceneInstancesCount=(e,t)=>{let s=0;const n=o.staticArray(o.evtTools.object.getSceneInstancesCount);t.keys(n);const i=new Set(n);for(const f of i)s+=e.getInstancesCountOnScene(f);return s},g.pickedObjectsCount=g.getPickedInstancesCount})(w=O.object||(O.object={}))})(y=o.evtTools||(o.evtTools={}));class C{constructor(){this.objectsLists=new Map;this.localVariablesContainers=[];this.callbacks=new Map;this.parent=null}static from(O){const h=new C;return h.parent=O,h}getOrCreateList(O){return this.objectsLists.has(O)||this.objectsLists.set(O,[]),this.objectsLists.get(O)}getObjects(O){return!this.objectsLists.has(O)&&this.parent?this.parent.getObjects(O):this.objectsLists.get(O)||[]}addObject(O,h){const m=this.getOrCreateList(O);if(m.includes(h))return;m.push(h);const v=()=>this.removeObject(O,h);this.callbacks.set(h,v),h.registerDestroyCallback(v)}removeObject(O,h){const m=this.getOrCreateList(O),v=m.indexOf(h);v!==-1&&(m.splice(v,1),h.unregisterDestroyCallback(this.callbacks.get(h)),this.callbacks.delete(h))}restoreLocalVariablesContainers(O){o.copyArray(this.localVariablesContainers,O)}backupLocalVariablesContainers(O){o.copyArray(O,this.localVariablesContainers)}}o.LongLivedObjectsList=C})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=objecttools.js.map
events-tools/runtimescenetools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(r){let c;(function(i){let u;(function(s){s.sceneJustBegins=function(e){return e.getScene().getTimeManager().isFirstFrame()},s.sceneJustResumed=function(e){return e.getScene().sceneJustResumed()},s.getSceneName=function(e){return e.getScene().getName()},s.setBackgroundColor=function(e,t){const n=t.split(";");n.length<3||e.getScene().setBackgroundColor(parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))},s.getElapsedTimeInSeconds=function(e){return e.getScene().getTimeManager().getElapsedTime()/1e3},s.setTimeScale=function(e,t){return e.getScene().getTimeManager().setTimeScale(t)},s.getTimeScale=function(e){return e.getScene().getTimeManager().getTimeScale()},s.timerElapsedTime=function(e,t,n){const a=e.getScene().getTimeManager();return a.hasTimer(n)?a.getTimer(n).getTime()/1e3>=t:(a.addTimer(n),!1)},s.timerPaused=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)?n.getTimer(t).isPaused():!1},s.resetTimer=function(e,t){const n=e.getScene().getTimeManager();n.hasTimer(t)?n.getTimer(t).reset():n.addTimer(t)},s.pauseTimer=function(e,t){const n=e.getScene().getTimeManager();n.hasTimer(t)||n.addTimer(t),n.getTimer(t).setPaused(!0)},s.unpauseTimer=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)||n.addTimer(t),n.getTimer(t).setPaused(!1)},s.removeTimer=function(e,t){e.getScene().getTimeManager().removeTimer(t)};class m extends r.AsyncTask{constructor(t){super();this.timeElapsedOnScene=0;this.duration=t}update(t){return this.timeElapsedOnScene+=t.getScene().getTimeManager().getElapsedTime(),this.timeElapsedOnScene>=this.duration}}s.WaitTask=m,s.wait=e=>new m(e*1e3),s.getTimerElapsedTimeInSeconds=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)?n.getTimer(t).getTime()/1e3:0},s.getTimerElapsedTimeInSecondsOrNaN=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)?n.getTimer(t).getTime()/1e3:Number.NaN},s.getTimeFromStartInSeconds=function(e){return e.getScene().getTimeManager().getTimeFromStart()/1e3},s.getTime=function(e,t){if(t==="timestamp")return Date.now();const n=new Date;if(t==="hour")return n.getHours();if(t==="min")return n.getMinutes();if(t==="sec")return n.getSeconds();if(t==="mday")return n.getDate();if(t==="mon")return n.getMonth();if(t==="year")return n.getFullYear()-1900;if(t==="wday")return n.getDay();if(t==="yday"){const a=new Date(n.getFullYear(),0,0),o=n.getTime()-a.getTime(),g=1e3*60*60*24;return Math.floor(o/g)}return 0},s.replaceScene=function(e,t,n){!e.getGame().getSceneAndExtensionsData(t)||e.getScene().requestChange(n?r.SceneChangeRequest.CLEAR_SCENES:r.SceneChangeRequest.REPLACE_SCENE,t)},s.pushScene=function(e,t){!e.getGame().getSceneAndExtensionsData(t)||e.getScene().requestChange(r.SceneChangeRequest.PUSH_SCENE,t)},s.popScene=function(e){e.getScene().requestChange(r.SceneChangeRequest.POP_SCENE)},s.stopGame=function(e){e.getScene().requestChange(r.SceneChangeRequest.STOP_GAME)},s.createObjectsFromExternalLayout=function(e,t,n,a,o){const g=e.getGame().getExternalLayoutData(t);g!==null&&e.getScene().createObjectsFrom(g.instances,n,a,o||0,!1)},s.hasGameJustResumed=e=>e.getGame().hasJustResumed(),s.doesSceneExist=(e,t)=>e.getGame().hasScene(t),s.prioritizeLoadingOfScene=(e,t)=>{e.getGame().prioritizeLoadingOfScene(t)},s.getSceneLoadingProgress=(e,t)=>e.getGame().getSceneLoadingProgress(t),s.areSceneAssetsLoaded=(e,t)=>e.getGame().areSceneAssetsLoaded(t)})(u=i.runtimeScene||(i.runtimeScene={}))})(c=r.evtTools||(r.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=runtimescenetools.js.map
events-tools/soundtools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(u){let s;(function(i){let r;(function(o){o.getGlobalVolume=function(n){return n.getScene().getSoundManager().getGlobalVolume()},o.setGlobalVolume=function(n,t){n.getScene().getSoundManager().setGlobalVolume(t)},o.unloadAllAudio=function(n){n.getScene().getSoundManager().unloadAll()},o.playSound=function(n,t,e,g,a){n.getScene().getSoundManager().playSound(t,e,g,a)},o.playSoundOnChannel=function(n,t,e,g,a,c){n.getScene().getSoundManager().playSoundOnChannel(t,e,g,a,c)},o.stopSoundOnChannel=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);e&&e.stop()},o.pauseSoundOnChannel=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);e&&e.pause()},o.continueSoundOnChannel=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);e&&(e.playing()||e.play())},o.isSoundOnChannelPlaying=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);return e?e.playing():!1},o.isSoundOnChannelPaused=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);return e?e.paused():!1},o.isSoundOnChannelStopped=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);return e?e.stopped():!0},o.getSoundOnChannelVolume=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);return e?e.getVolume()*100:100},o.setSoundOnChannelVolume=function(n,t,e){const g=n.getScene().getSoundManager().getSoundOnChannel(t);g&&g.setVolume(e/100)},o.getSoundOnChannelPlayingOffset=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);return e?e.getSeek():0},o.setSoundOnChannelPlayingOffset=function(n,t,e){const g=n.getScene().getSoundManager().getSoundOnChannel(t);g&&g.setSeek(e)},o.getSoundOnChannelPitch=function(n,t){const e=n.getScene().getSoundManager().getSoundOnChannel(t);return e?e.getRate():1},o.setSoundOnChannelPitch=function(n,t,e){const g=n.getScene().getSoundManager().getSoundOnChannel(t);g&&g.setRate(e)},o.preloadSound=(n,t)=>n.getScene().getSoundManager().loadAudio(t,!1),o.unloadSound=(n,t)=>n.getScene().getSoundManager().unloadAudio(t,!1),o.playMusic=function(n,t,e,g,a){n.getScene().getSoundManager().playMusic(t,e,g,a)},o.playMusicOnChannel=function(n,t,e,g,a,c){n.getScene().getSoundManager().playMusicOnChannel(t,e,g,a,c)},o.stopMusicOnChannel=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);e&&e.stop()},o.pauseMusicOnChannel=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);e&&e.pause()},o.continueMusicOnChannel=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);e&&(e.playing()||e.play())},o.isMusicOnChannelPlaying=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);return e?e.playing():!1},o.isMusicOnChannelPaused=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);return e?e.paused():!1},o.isMusicOnChannelStopped=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);return e?e.stopped():!0},o.getMusicOnChannelVolume=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);return e?e.getVolume()*100:100},o.setMusicOnChannelVolume=function(n,t,e){const g=n.getScene().getSoundManager().getMusicOnChannel(t);g&&g.setVolume(e/100)},o.getMusicOnChannelPlayingOffset=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);return e?e.getSeek():0},o.setMusicOnChannelPlayingOffset=function(n,t,e){const g=n.getScene().getSoundManager().getMusicOnChannel(t);g&&g.setSeek(e)},o.getMusicOnChannelPitch=function(n,t){const e=n.getScene().getSoundManager().getMusicOnChannel(t);return e?e.getRate():1},o.setMusicOnChannelPitch=function(n,t,e){const g=n.getScene().getSoundManager().getMusicOnChannel(t);g&&g.setRate(e)},o.preloadMusic=(n,t)=>n.getScene().getSoundManager().loadAudio(t,!0),o.unloadMusic=(n,t)=>n.getScene().getSoundManager().unloadAudio(t,!0),o.fadeSoundVolume=(n,t,e,g)=>{const a=n.getScene().getSoundManager().getSoundOnChannel(t);a&&a.fade(a.getVolume(),e/100,g*1e3)},o.fadeMusicVolume=(n,t,e,g)=>{const a=n.getScene().getSoundManager().getMusicOnChannel(t);a&&a.fade(a.getVolume(),e/100,g*1e3)}})(r=i.sound||(i.sound={}))})(s=u.evtTools||(u.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=soundtools.js.map
events-tools/storagetools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(S){const f=new S.Logger("Storage");let d;(function(p){let h;(function(a){let c=null;try{typeof cc!="undefined"?c=cc.sys.localStorage:typeof window!="undefined"&&(c=window.localStorage)}catch(t){f.error("Unable to get access to the localStorage: "+t)}c||f.error("Storage actions won't work as no localStorage was found.");const u=new Hashtable;a.loadJSONFileFromStorage=t=>{if(u.containsKey(t))return;let i=null;try{c&&(i=c.getItem("GDJS_"+t))}catch(l){f.error('Unable to load data from localStorage for "'+t+'": '+l)}let o={};try{i&&(o=JSON.parse(i))}catch(l){f.error('Unable to load data from "'+t+'" - data is not valid JSON: '+l)}u.put(t,o)},a.unloadJSONFile=t=>{if(!u.containsKey(t))return;const i=u.get(t),o=JSON.stringify(i);try{c&&c.setItem("GDJS_"+t,o)}catch(l){f.error('Unable to save data to localStorage for "'+t+'": '+l)}u.remove(t)};const g=(t,i)=>{let o=!1;u.containsKey(t)||(o=!0,a.loadJSONFileFromStorage(t));const l=i(u.get(t));return o&&a.unloadJSONFile(t),l};a.clearJSONFile=t=>g(t,i=>{for(const o in i)i.hasOwnProperty(o)&&delete i[o];return!0}),a.elementExistsInJSONFile=(t,i)=>g(t,o=>{const l=i.split("/");let n=o;for(let e=0;e<l.length;++e){if(!n[l[e]])return!1;n=n[l[e]]}return!0}),a.deleteElementFromJSONFile=(t,i)=>g(t,o=>{const l=i.split("/");let n=o;for(let e=0;e<l.length;++e){if(!n[l[e]])return!1;e===l.length-1?delete n[l[e]]:n=n[l[e]]}return!0}),a.writeNumberInJSONFile=(t,i,o)=>g(t,l=>{const n=i.split("/");let e=l;for(let r=0;r<n.length;++r)e[n[r]]||(e[n[r]]={}),r===n.length-1?e[n[r]].value=o:e=e[n[r]];return!0}),a.writeStringInJSONFile=(t,i,o)=>g(t,l=>{const n=i.split("/");let e=l;for(let r=0;r<n.length;++r)e[n[r]]||(e[n[r]]={}),r===n.length-1?e[n[r]].str=o:e=e[n[r]];return!0}),a.readNumberFromJSONFile=(t,i,o,l)=>g(t,n=>{const e=i.split("/");let r=n;for(let s=0;s<e.length;++s){if(!r[e[s]])return!1;s===e.length-1&&typeof r[e[s]].value!="undefined"?l.setNumber(r[e[s]].value):r=r[e[s]]}return!0}),a.readStringFromJSONFile=(t,i,o,l)=>g(t,n=>{const e=i.split("/");let r=n;for(let s=0;s<e.length;++s){if(!r[e[s]])return!1;s===e.length-1&&typeof r[e[s]].str!="undefined"?l.setString(r[e[s]].str):r=r[e[s]]}return!0})})(h=p.storage||(p.storage={}))})(d=S.evtTools||(S.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=storagetools.js.map
events-tools/stringtools.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ var gdjs;(function(s){let p;(function(c){let f;(function(e){e.newLine=function(){return`
2
+ `},e.fromCodePoint=function(t){return String.fromCodePoint(t)},e.toUpperCase=function(t){return t.toUpperCase()},e.toLowerCase=function(t){return t.toLowerCase()},e.subStr=function(t,n,r){return n<t.length&&n>=0?t.substr(n,r):""},e.strAt=function(t,n){return n<t.length&&n>=0?t.substr(n,1):""},e.strRepeat=function(t,n){let r="";for(let o=0;o<n;o++)r+=t;return r},e.strLen=function(t){return t.length},e.strFind=function(t,n){return t.indexOf(n)},e.strFindLast=function(t,n){return t.lastIndexOf(n)},e.strRFind=s.evtTools.string.strFindLast,e.strFindFrom=function(t,n,r){return t.indexOf(n,r)},e.strFindLastFrom=function(t,n,r){return t.lastIndexOf(n,r)},e.strReplaceOne=function(t,n,r){return t.replace(n,r)},e.strReplaceAll=function(t,n,r){let o=t,u=0,i=o.indexOf(n,u);for(;i!==-1&&(o=o.substring(0,i)+r+o.substring(i+n.length,o.length),u=i+r.length+(n.length===0?1:0),!(u>o.length));)i=o.indexOf(n,u);return o},e.strRFindFrom=s.evtTools.string.strFindLastFrom})(f=c.string||(c.string={}))})(p=s.evtTools||(s.evtTools={}))})(gdjs||(gdjs={}));
3
+ //# sourceMappingURL=stringtools.js.map
events-tools/variabletools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(a){let l;(function(o){let i;(function(r){r.getVariableNumber=function(e){return e.getAsNumber()},r.getVariableString=function(e){return e.getAsString()},r.getVariableBoolean=function(e,t){return e.getAsBoolean()===t},r.setVariableBoolean=function(e,t){e.setBoolean(t)},r.toggleVariableBoolean=function(e){e.setBoolean(!e.getAsBoolean())},r.sceneVariableExists=function(e,t){return e.getScene().getVariables().has(t)},r.globalVariableExists=function(e,t){return e.getGame().getVariables().has(t)},r.variableChildExists=function(e,t){return e.hasChild(t)},r.variableRemoveChild=function(e,t){e.removeChild(t)},r.variableClearChildren=function(e){e.clearChildren()},r.variablePushCopy=function(e,t){e.pushVariableCopy(t)},r.valuePush=function(e,t){e.pushValue(t)},r.variableRemoveAt=function(e,t){e.removeAtIndex(t)},r.getVariableChildCount=function(e){return e.getChildrenCount()},r.getFirstVariableNumber=function(e){return e.getChildrenCount()===0?0:e.getAllChildrenArray()[0].getAsNumber()},r.getFirstVariableString=function(e){return e.getChildrenCount()===0?"":e.getAllChildrenArray()[0].getAsString()},r.getLastVariableNumber=function(e){const t=e.getAllChildrenArray();return t.length===0?0:t[t.length-1].getAsNumber()},r.getLastVariableString=function(e){const t=e.getAllChildrenArray();return t.length===0?"":t[t.length-1].getAsString()}})(i=o.variable||(o.variable={}));let s;(function(n){n.getVariableNumber=a.evtTools.variable.getVariableNumber,n.getVariableString=a.evtTools.variable.getVariableString,n.getVariableBoolean=a.evtTools.variable.getVariableBoolean,n.setVariableBoolean=a.evtTools.variable.setVariableBoolean,n.toggleVariableBoolean=a.evtTools.variable.toggleVariableBoolean,n.sceneVariableExists=a.evtTools.variable.sceneVariableExists,n.globalVariableExists=a.evtTools.variable.globalVariableExists,n.variableChildExists=a.evtTools.variable.variableChildExists,n.variableRemoveChild=a.evtTools.variable.variableRemoveChild,n.variableClearChildren=a.evtTools.variable.variableClearChildren,n.variablePushCopy=a.evtTools.variable.variablePushCopy,n.valuePush=a.evtTools.variable.valuePush,n.variableRemoveAt=a.evtTools.variable.variableRemoveAt,n.getVariableChildCount=a.evtTools.variable.getVariableChildCount})(s=o.common||(o.common={}))})(l=a.evtTools||(a.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=variabletools.js.map
events-tools/windowtools.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(r){let s;(function(u){let m;(function(t){t.setMargins=function(e,n,o,i,g){e.getGame().getRenderer().setMargins(n,o,i,g)},t.setFullScreen=function(e,n,o){e.getGame().getRenderer().keepAspectRatio(o),e.getGame().getRenderer().setFullScreen(n)},t.isFullScreen=function(e){return e.getGame().getRenderer().isFullScreen()},t.setWindowSize=function(e,n,o,i){e.getGame().getRenderer().setWindowSize(n,o),i&&e.getGame().setGameResolutionSize(n,o)},t.centerWindow=function(e){e.getGame().getRenderer().centerWindow()},t.setGameResolutionSize=function(e,n,o){e.getGame().setGameResolutionSize(n,o)},t.setGameResolutionResizeMode=function(e,n){e.getGame().setGameResolutionResizeMode(n)},t.setAdaptGameResolutionAtRuntime=function(e,n){e.getGame().setAdaptGameResolutionAtRuntime(n)},t.setWindowTitle=function(e,n){e.getGame().getRenderer().setWindowTitle(n)},t.getWindowTitle=function(e){return e.getGame().getRenderer().getWindowTitle()},t.getWindowInnerWidth=function(){return r.RuntimeGameRenderer&&r.RuntimeGameRenderer.getWindowInnerWidth?r.RuntimeGameRenderer.getWindowInnerWidth():typeof t!="undefined"?t.innerWidth:800},t.getWindowInnerHeight=function(){return r.RuntimeGameRenderer&&r.RuntimeGameRenderer.getWindowInnerHeight?r.RuntimeGameRenderer.getWindowInnerHeight():typeof t!="undefined"?t.innerHeight:800},t.getGameResolutionWidth=function(e){return e.getGame().getGameResolutionWidth()},t.getGameResolutionHeight=function(e){return e.getGame().getGameResolutionHeight()},t.openURL=function(e,n){return n.getGame().getRenderer().openURL(e)}})(m=u.window||(u.window={}))})(s=r.evtTools||(r.evtTools={}))})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=windowtools.js.map
fontfaceobserver-font-manager/fontfaceobserver-font-manager.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(i){const s=new i.Logger("Font manager"),d=["font"];class c{constructor(r){this._loadedFontFamily=new i.ResourceCache;this._loadedFontFamilySet=new Set;this._resourceLoader=r}getResourceKinds(){return d}getFontFamily(r){return this._loadedFontFamily.getFromName(r)||"Arial"}getFontFile(r){const e=this._resourceLoader.getResource(r);return e?e.file||"":r}_getFontFamilyFromFilename(r){let e="gdjs_font_"+r.file.toLowerCase().replace(/[^\w]/gi,"-");const o=e;let n=2;for(;this._loadedFontFamilySet.has(e);)e=e+"-"+n,n++;return o}_loadFont(r,e){const o={},n="url("+encodeURI(e)+")";if(typeof FontFace!="undefined")return fetch(this._resourceLoader.getFullUrl(e),{credentials:this._resourceLoader.checkIfCredentialsRequired(e)?"include":"same-origin"}).then(t=>{if(!t.ok){const a="Unable to fetch "+e+" to be loaded as a font. HTTP status is: "+t.status+".";throw s.error(a),new Error(a)}return t.arrayBuffer()}).then(t=>{const a=new FontFace(r,t,o);document.fonts.add(a)});{const t=document.createElement("style");return t.appendChild(document.createTextNode("@font-face { font-family: '"+r+"'; src: "+n+"; }")),document.head.appendChild(t),new FontFaceObserver(r,o).load()}}async processResource(r){}async loadResource(r){const e=this._resourceLoader.getResource(r);if(!e){s.warn('Unable to find font for resource "'+r+'".');return}if(this._loadedFontFamily.get(e))return;const o=e.file;if(!o)return;const n=this._getFontFamilyFromFilename(e);this._loadedFontFamily.set(e,n),this._loadedFontFamilySet.add(n);try{await this._loadFont(n,o)}catch(t){s.error('Error loading font resource "'+e.name+'" (file: '+o+"): "+(t.message||"Unknown error"))}}dispose(){this._loadedFontFamily.clear(),this._loadedFontFamilySet.clear()}}i.FontFaceObserverFontManager=c,i.FontManager=c})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=fontfaceobserver-font-manager.js.map
fontfaceobserver-font-manager/fontfaceobserver.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ var module; //Define an undefined module variable to avoid fontfaceobserver thinking it's used in an environment using require.
3
+
4
+ /* Font Face Observer v2.0.13 - © Bram Stein. License: BSD-3-Clause */(function(){'use strict';var f,g=[];function l(a){g.push(a);1==g.length&&f()}function m(){for(;g.length;)g[0](),g.shift()}f=function(){setTimeout(m)};function n(a){this.a=p;this.b=void 0;this.f=[];var b=this;try{a(function(a){q(b,a)},function(a){r(b,a)})}catch(c){r(b,c)}}var p=2;function t(a){return new n(function(b,c){c(a)})}function u(a){return new n(function(b){b(a)})}function q(a,b){if(a.a==p){if(b==a)throw new TypeError;var c=!1;try{var d=b&&b.then;if(null!=b&&"object"==typeof b&&"function"==typeof d){d.call(b,function(b){c||q(a,b);c=!0},function(b){c||r(a,b);c=!0});return}}catch(e){c||r(a,e);return}a.a=0;a.b=b;v(a)}}
5
+ function r(a,b){if(a.a==p){if(b==a)throw new TypeError;a.a=1;a.b=b;v(a)}}function v(a){l(function(){if(a.a!=p)for(;a.f.length;){var b=a.f.shift(),c=b[0],d=b[1],e=b[2],b=b[3];try{0==a.a?"function"==typeof c?e(c.call(void 0,a.b)):e(a.b):1==a.a&&("function"==typeof d?e(d.call(void 0,a.b)):b(a.b))}catch(h){b(h)}}})}n.prototype.g=function(a){return this.c(void 0,a)};n.prototype.c=function(a,b){var c=this;return new n(function(d,e){c.f.push([a,b,d,e]);v(c)})};
6
+ function w(a){return new n(function(b,c){function d(c){return function(d){h[c]=d;e+=1;e==a.length&&b(h)}}var e=0,h=[];0==a.length&&b(h);for(var k=0;k<a.length;k+=1)u(a[k]).c(d(k),c)})}function x(a){return new n(function(b,c){for(var d=0;d<a.length;d+=1)u(a[d]).c(b,c)})};window.Promise||(window.Promise=n,window.Promise.resolve=u,window.Promise.reject=t,window.Promise.race=x,window.Promise.all=w,window.Promise.prototype.then=n.prototype.c,window.Promise.prototype["catch"]=n.prototype.g);}());
7
+
8
+ (function(){function l(a,b){document.addEventListener?a.addEventListener("scroll",b,!1):a.attachEvent("scroll",b)}function m(a){document.body?a():document.addEventListener?document.addEventListener("DOMContentLoaded",function c(){document.removeEventListener("DOMContentLoaded",c);a()}):document.attachEvent("onreadystatechange",function k(){if("interactive"==document.readyState||"complete"==document.readyState)document.detachEvent("onreadystatechange",k),a()})};function r(a){this.a=document.createElement("div");this.a.setAttribute("aria-hidden","true");this.a.appendChild(document.createTextNode(a));this.b=document.createElement("span");this.c=document.createElement("span");this.h=document.createElement("span");this.f=document.createElement("span");this.g=-1;this.b.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";this.c.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";
9
+ this.f.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;";this.h.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;";this.b.appendChild(this.h);this.c.appendChild(this.f);this.a.appendChild(this.b);this.a.appendChild(this.c)}
10
+ function t(a,b){a.a.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+b+";"}function y(a){var b=a.a.offsetWidth,c=b+100;a.f.style.width=c+"px";a.c.scrollLeft=c;a.b.scrollLeft=a.b.scrollWidth+100;return a.g!==b?(a.g=b,!0):!1}function z(a,b){function c(){var a=k;y(a)&&a.a.parentNode&&b(a.g)}var k=a;l(a.b,c);l(a.c,c);y(a)};function A(a,b){var c=b||{};this.family=a;this.style=c.style||"normal";this.weight=c.weight||"normal";this.stretch=c.stretch||"normal"}var B=null,C=null,E=null,F=null;function G(){if(null===C)if(J()&&/Apple/.test(window.navigator.vendor)){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent);C=!!a&&603>parseInt(a[1],10)}else C=!1;return C}function J(){null===F&&(F=!!document.fonts);return F}
11
+ function K(){if(null===E){var a=document.createElement("div");try{a.style.font="condensed 100px sans-serif"}catch(b){}E=""!==a.style.font}return E}function L(a,b){return[a.style,a.weight,K()?a.stretch:"","100px",b].join(" ")}
12
+ A.prototype.load=function(a,b){var c=this,k=a||"BESbswy",q=0,D=b||3E3,H=(new Date).getTime();return new Promise(function(a,b){if(J()&&!G()){var M=new Promise(function(a,b){function e(){(new Date).getTime()-H>=D?b():document.fonts.load(L(c,'"'+c.family+'"'),k).then(function(c){1<=c.length?a():setTimeout(e,25)},function(){b()})}e()}),N=new Promise(function(a,c){q=setTimeout(c,D)});Promise.race([N,M]).then(function(){clearTimeout(q);a(c)},function(){b(c)})}else m(function(){function u(){var b;if(b=-1!=
13
+ f&&-1!=g||-1!=f&&-1!=h||-1!=g&&-1!=h)(b=f!=g&&f!=h&&g!=h)||(null===B&&(b=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),B=!!b&&(536>parseInt(b[1],10)||536===parseInt(b[1],10)&&11>=parseInt(b[2],10))),b=B&&(f==v&&g==v&&h==v||f==w&&g==w&&h==w||f==x&&g==x&&h==x)),b=!b;b&&(d.parentNode&&d.parentNode.removeChild(d),clearTimeout(q),a(c))}function I(){if((new Date).getTime()-H>=D)d.parentNode&&d.parentNode.removeChild(d),b(c);else{var a=document.hidden;if(!0===a||void 0===a)f=e.a.offsetWidth,
14
+ g=n.a.offsetWidth,h=p.a.offsetWidth,u();q=setTimeout(I,50)}}var e=new r(k),n=new r(k),p=new r(k),f=-1,g=-1,h=-1,v=-1,w=-1,x=-1,d=document.createElement("div");d.dir="ltr";t(e,L(c,"sans-serif"));t(n,L(c,"serif"));t(p,L(c,"monospace"));d.appendChild(e.a);d.appendChild(n.a);d.appendChild(p.a);document.body.appendChild(d);v=e.a.offsetWidth;w=n.a.offsetWidth;x=p.a.offsetWidth;I();z(e,function(a){f=a;u()});t(e,L(c,'"'+c.family+'",sans-serif'));z(n,function(a){g=a;u()});t(n,L(c,'"'+c.family+'",serif'));
15
+ z(p,function(a){h=a;u()});t(p,L(c,'"'+c.family+'",monospace'))})})};"object"===typeof module?module.exports=A:(window.FontFaceObserver=A,window.FontFaceObserver.prototype.load=A.prototype.load);}());
16
+ })()
force.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(e){class s{constructor(t,i,h){this._dirty=!1;this._x=t||0,this._y=i||0,this._angle=Math.atan2(i,t)*180/Math.PI,this._length=Math.sqrt(t*t+i*i),this._multiplier=h}getX(){return this._x}getY(){return this._y}setX(t){this._x=t,this._dirty=!0}setY(t){this._y=t,this._dirty=!0}clear(){this._x=0,this._y=0,this._length=0,this._dirty=!1}addForce(t){this._x+=t._x,this._y+=t._y,this._dirty=!0}add(t,i){this._x+=t,this._y+=i,this._dirty=!0}setAngle(t){this._dirty&&(this._length=Math.sqrt(this._x*this._x+this._y*this._y),this._dirty=!1),this._angle=t;const i=t/180*Math.PI;this._x=Math.cos(i)*this._length,this._y=Math.sin(i)*this._length}setLength(t){this._dirty&&(this._angle=Math.atan2(this._y,this._x)*180/Math.PI,this._dirty=!1),this._length=t;const i=this._angle/180*Math.PI;this._x=Math.cos(i)*this._length,this._y=Math.sin(i)*this._length}getAngle(){return this._dirty&&(this._angle=Math.atan2(this._y,this._x)*180/Math.PI,this._length=Math.sqrt(this._x*this._x+this._y*this._y),this._dirty=!1),this._angle}getLength(){return this._dirty&&(this._angle=Math.atan2(this._y,this._x)*180/Math.PI,this._length=Math.sqrt(this._x*this._x+this._y*this._y),this._dirty=!1),this._length}getMultiplier(){return this._multiplier}setMultiplier(t){this._multiplier=t}getNetworkSyncData(){return{x:this._x,y:this._y,a:this._angle,l:this._length,m:this._multiplier}}updateFromNetworkSyncData(t){this._x=t.x,this._y=t.y,this._angle=t.a,this._length=t.l,this._multiplier=t.m}}e.Force=s})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=force.js.map
gd.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(t){const i=new t.Logger("Engine runtime"),l=/^(#{0,1}[A-Fa-f0-9]{6})$/,s=/^(#{0,1}[A-Fa-f0-9]{3})$/,b=/^(\d{1,3};\d{1,3};\d{1,3})/;let f;(function(n){const e=!0})(f=t.evtTools||(t.evtTools={})),t.objectsTypes=new Hashtable,t.behaviorsTypes=new Hashtable,t.callbacksFirstRuntimeSceneLoaded=[],t.callbacksRuntimeSceneLoaded=[],t.callbacksRuntimeScenePreEvents=[],t.callbacksRuntimeScenePostEvents=[],t.callbacksRuntimeScenePaused=[],t.callbacksRuntimeSceneResumed=[],t.callbacksRuntimeSceneUnloading=[],t.callbacksRuntimeSceneUnloaded=[],t.callbacksObjectDeletedFromScene=[],t.gdevelopLogo="",t.rgbToHex=function(e,n,r){return""+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)},t.hexToRGBColor=function(e){const n=parseInt(e.replace("#",""),16);return Number.isFinite(n)?[n>>16&255,n>>8&255,n&255]:[0,0,0]},t.shorthandHexToRGBColor=function(e){const n=parseInt(e.replace("#",""),16);return Number.isFinite(n)?[17*(n>>8&15),17*(n>>4&15),17*(n&15)]:[0,0,0]},t.rgbOrHexToRGBColor=function(e){const n=t.extractRGBString(e);if(n){const a=n.split(";");if(a.length===3)return[Math.min(255,parseInt(a[0],10)),Math.min(255,parseInt(a[1],10)),Math.min(255,parseInt(a[2],10))]}const r=t.extractHexString(e);if(r)return t.hexToRGBColor(r);const o=t.extractShorthandHexString(e);return o?t.shorthandHexToRGBColor(o):[0,0,0]},t.rgbOrHexStringToNumber=e=>{const n=t.rgbOrHexToRGBColor(e);return t.rgbToHexNumber(n[0],n[1],n[2])},t.rgbToHexNumber=function(e,n,r){return(e<<16)+(n<<8)+r},t.hexNumberToRGB=e=>({r:e>>16&255,g:e>>8&255,b:e&255,a:255}),t.hexNumberToRGBArray=e=>[e>>16&255,e>>8&255,e&255],t.extractHexString=e=>{const n=e.match(l);return n?n[0]:null},t.extractShorthandHexString=e=>{const n=e.match(s);return n?n[0]:null},t.extractRGBString=e=>{const n=e.match(b);return n?n[0]:null},t.random=function(e){return e<=0?0:Math.floor(Math.random()*(e+1))},t.randomInRange=function(e,n){return e+t.random(n-e)},t.randomFloat=function(e){return e<=0?0:Math.random()*e},t.randomFloatInRange=function(e,n){return e+t.randomFloat(n-e)},t.randomWithStep=function(e,n,r){return r<=0?e+t.random(n-e):e+t.random(Math.floor((n-e)/r))*r},t.toRad=function(e){return e/180*Math.PI},t.toDegrees=function(e){return e*180/Math.PI},t.registerObject=function(e,n){t.objectsTypes.put(e,n)},t.registerBehavior=function(e,n){t.behaviorsTypes.put(e,n)},t.registerFirstRuntimeSceneLoadedCallback=function(e){t.callbacksFirstRuntimeSceneLoaded.push(e)},t.registerRuntimeSceneLoadedCallback=function(e){t.callbacksRuntimeSceneLoaded.push(e)},t.registerRuntimeScenePreEventsCallback=function(e){t.callbacksRuntimeScenePreEvents.push(e)},t.registerRuntimeScenePostEventsCallback=function(e){t.callbacksRuntimeScenePostEvents.push(e)},t.registerRuntimeScenePausedCallback=function(e){t.callbacksRuntimeScenePaused.push(e)},t.registerRuntimeSceneResumedCallback=function(e){t.callbacksRuntimeSceneResumed.push(e)},t.registerRuntimeSceneUnloadingCallback=function(e){t.callbacksRuntimeSceneUnloading.push(e)},t.registerRuntimeSceneUnloadedCallback=function(e){t.callbacksRuntimeSceneUnloaded.push(e)},t.registerObjectDeletedFromSceneCallback=function(e){t.callbacksObjectDeletedFromScene.push(e)},t._unregisterCallback=function(e){const n=r=>{for(let o=0;o<r.length;)r[o]===e?r.splice(o,1):o++};n(t.callbacksFirstRuntimeSceneLoaded),n(t.callbacksRuntimeSceneLoaded),n(t.callbacksRuntimeScenePreEvents),n(t.callbacksRuntimeScenePostEvents),n(t.callbacksRuntimeScenePaused),n(t.callbacksRuntimeSceneResumed),n(t.callbacksRuntimeSceneUnloading),n(t.callbacksRuntimeSceneUnloaded),n(t.callbacksObjectDeletedFromScene)},t.registerGlobalCallbacks=function(){i.warn("You're calling gdjs.registerGlobalCallbacks. This method is now useless and you must not call it anymore.")},t.getObjectConstructor=function(e){return e!==void 0&&t.objectsTypes.containsKey(e)?t.objectsTypes.get(e):(i.warn('Object type "'+e+'" was not found.'),t.objectsTypes.get(""))},t.getBehaviorConstructor=function(e){return e!==void 0&&t.behaviorsTypes.containsKey(e)?t.behaviorsTypes.get(e):(i.warn('Behavior type "'+e+'" was not found.'),t.behaviorsTypes.get(""))},t.staticArray=function(e){return e._staticArray=e._staticArray||[],e._staticArray},t.staticArray2=function(e){return e._staticArray2=e._staticArray2||[],e._staticArray2},t.staticObject=function(e){return e._staticObject=e._staticObject||{},e._staticObject},t.objectsListsToArray=function(e){var n=t.staticArray(t.objectsListsToArray);e.values(n);for(var r=[],o=0;o<n.length;++o)for(var a=n[o],c=0;c<a.length;++c)r.push(a[c]);return r},t.copyArray=function(e,n){for(var r=e.length,o=0;o<r;++o)n[o]=e[o];n.length=r},t.makeUuid=function(){if(typeof crypto=="undefined"||!crypto.getRandomValues){const o=a=>a?(a^Math.random()*16>>a/4).toString(16):(""+1e7+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,o);return o()}if(!t.makeUuid.hex){t.makeUuid.hex=[];for(var e=0;e<256;e++)t.makeUuid.hex[e]=(e<16?"0":"")+e.toString(16)}const n=t.makeUuid.hex;var r=crypto.getRandomValues(new Uint8Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,n[r[0]]+n[r[1]]+n[r[2]]+n[r[3]]+"-"+n[r[4]]+n[r[5]]+"-"+n[r[6]]+n[r[7]]+"-"+n[r[8]]+n[r[9]]+"-"+n[r[10]]+n[r[11]]+n[r[12]]+n[r[13]]+n[r[14]]+n[r[15]]},t.nearlyEqual=(e,n,r)=>{const o=Math.abs(e),a=Math.abs(n),c=Math.abs(e-n);return e===n?!0:e==0||n==0||o+a<Number.EPSILON?c<r*Number.EPSILON:c/Math.min(o+a,Number.MAX_VALUE)<r};const u=[];t.registerAsynchronouslyLoadingLibraryPromise=e=>{u.push(e)},t.getAllAsynchronouslyLoadingLibraryPromise=()=>Promise.all(u)})(gdjs||(gdjs={})),console.warn=console.warn||console.log,console.error=console.error||console.log;
2
+ //# sourceMappingURL=gd.js.map
gdjs-evtsext__voicerecognition__onerror-func.js ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (typeof gdjs.evtsExt__VoiceRecognition__OnError !== "undefined") {
3
+ gdjs.evtsExt__VoiceRecognition__OnError.registeredGdjsCallbacks.forEach(callback =>
4
+ gdjs._unregisterCallback(callback)
5
+ );
6
+ }
7
+
8
+ gdjs.evtsExt__VoiceRecognition__OnError = {};
9
+
10
+
11
+ gdjs.evtsExt__VoiceRecognition__OnError.userFunc0x857568 = function GDJSInlineCode(runtimeScene, eventsFunctionContext) {
12
+ "use strict";
13
+ eventsFunctionContext.returnValue = gdjs._extensionVoiceRecognition.errorStatus;
14
+ };
15
+ gdjs.evtsExt__VoiceRecognition__OnError.eventsList0 = function(runtimeScene, eventsFunctionContext) {
16
+
17
+ {
18
+
19
+
20
+ let isConditionTrue_0 = false;
21
+ {
22
+ }
23
+
24
+ }
25
+
26
+
27
+ {
28
+
29
+
30
+ gdjs.evtsExt__VoiceRecognition__OnError.userFunc0x857568(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
31
+
32
+ }
33
+
34
+
35
+ };
36
+
37
+ gdjs.evtsExt__VoiceRecognition__OnError.func = function(runtimeScene, parentEventsFunctionContext) {
38
+ var eventsFunctionContext = {
39
+ _objectsMap: {
40
+ },
41
+ _objectArraysMap: {
42
+ },
43
+ _behaviorNamesMap: {
44
+ },
45
+ globalVariablesForExtension: runtimeScene.getGame().getVariablesForExtension("VoiceRecognition"),
46
+ sceneVariablesForExtension: runtimeScene.getScene().getVariablesForExtension("VoiceRecognition"),
47
+ localVariables: [],
48
+ getObjects: function(objectName) {
49
+ return eventsFunctionContext._objectArraysMap[objectName] || [];
50
+ },
51
+ getObjectsLists: function(objectName) {
52
+ return eventsFunctionContext._objectsMap[objectName] || null;
53
+ },
54
+ getBehaviorName: function(behaviorName) {
55
+ return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
56
+ },
57
+ createObject: function(objectName) {
58
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
59
+ if (objectsList) {
60
+ const object = parentEventsFunctionContext ?
61
+ parentEventsFunctionContext.createObject(objectsList.firstKey()) :
62
+ runtimeScene.createObject(objectsList.firstKey());
63
+ if (object) {
64
+ objectsList.get(objectsList.firstKey()).push(object);
65
+ eventsFunctionContext._objectArraysMap[objectName].push(object);
66
+ }
67
+ return object; }
68
+ return null;
69
+ },
70
+ getInstancesCountOnScene: function(objectName) {
71
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
72
+ let count = 0;
73
+ if (objectsList) {
74
+ for(const objectName in objectsList.items)
75
+ count += parentEventsFunctionContext ?
76
+ parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
77
+ runtimeScene.getInstancesCountOnScene(objectName);
78
+ }
79
+ return count;
80
+ },
81
+ getLayer: function(layerName) {
82
+ return runtimeScene.getLayer(layerName);
83
+ },
84
+ getArgument: function(argName) {
85
+ return "";
86
+ },
87
+ getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
88
+ };
89
+
90
+
91
+ gdjs.evtsExt__VoiceRecognition__OnError.eventsList0(runtimeScene, eventsFunctionContext);
92
+
93
+
94
+ return !!eventsFunctionContext.returnValue;
95
+ }
96
+
97
+ gdjs.evtsExt__VoiceRecognition__OnError.registeredGdjsCallbacks = [];
gdjs-evtsext__voicerecognition__onfirstsceneloaded-func.js ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (typeof gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded !== "undefined") {
3
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.registeredGdjsCallbacks.forEach(callback =>
4
+ gdjs._unregisterCallback(callback)
5
+ );
6
+ }
7
+
8
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded = {};
9
+
10
+
11
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.userFunc0x83f3a8 = function GDJSInlineCode(runtimeScene, eventsFunctionContext) {
12
+ "use strict";
13
+ function VoiceRecognition() {
14
+ this.errorStatus = false;
15
+ this.successStatus = false;
16
+
17
+ this.setStatus = function (status) {
18
+ this.status = status;
19
+ }
20
+
21
+ this.setError = function (error) {
22
+ this.error = error;
23
+ }
24
+
25
+ this.setResultText = function (result) {
26
+ this.result = result;
27
+ }
28
+
29
+ this.getResultText = function () {
30
+ return this.result;
31
+ }
32
+
33
+ this.getStatus = function () {
34
+ return this.status;
35
+ }
36
+
37
+ this.getError = function () {
38
+ return this.error;
39
+ }
40
+
41
+ this.setLanguage = function (lang) {
42
+ this.recognition.lang = lang;
43
+ }
44
+
45
+ let parent = this;
46
+
47
+ var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition
48
+ var SpeechGrammarList = SpeechGrammarList || window.webkitSpeechGrammarList
49
+ var SpeechRecognitionEvent = SpeechRecognitionEvent || webkitSpeechRecognitionEvent
50
+
51
+ this.recognition = new SpeechRecognition();
52
+
53
+ this.recognition.continuous = false;
54
+ this.recognition.interimResults = false;
55
+ this.recognition.maxAlternatives = 1;
56
+
57
+ // This runs when the speech recognition service starts
58
+ this.recognition.onstart = function() {
59
+ parent.setStatus("listening, please speak...");
60
+ };
61
+
62
+ this.recognition.onspeechend = function() {
63
+ parent.recognition.stop();
64
+ }
65
+
66
+ this.recognition.onerror = function(event) {
67
+ parent.errorStatus = true;
68
+ parent.setError('Error occurred in recognition: ' + event.error);
69
+ }
70
+
71
+ // This runs when the speech recognition service returns result
72
+ this.recognition.onresult = function(event) {
73
+ var transcript = event.results[0][0].transcript;
74
+ var confidence = event.results[0][0].confidence;
75
+
76
+ parent.successStatus = true;
77
+ parent.confidence = confidence;
78
+ parent.setResultText(transcript);
79
+ };
80
+
81
+ // start recognition
82
+ this.startListening = function() {
83
+ parent.recognition.start();
84
+
85
+ parent.errorStatus = false;
86
+ parent.successStatus = false;
87
+ parent.setStatus("listening, please speak...");
88
+ }
89
+ }
90
+
91
+ if(gdjs._extensionVoiceRecognition == undefined) {
92
+ gdjs._extensionVoiceRecognition = new VoiceRecognition();
93
+ }
94
+
95
+
96
+ };
97
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.eventsList0 = function(runtimeScene, eventsFunctionContext) {
98
+
99
+ {
100
+
101
+
102
+ let isConditionTrue_0 = false;
103
+ {
104
+ }
105
+
106
+ }
107
+
108
+
109
+ {
110
+
111
+
112
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.userFunc0x83f3a8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
113
+
114
+ }
115
+
116
+
117
+ };
118
+
119
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.func = function(runtimeScene, parentEventsFunctionContext) {
120
+ var eventsFunctionContext = {
121
+ _objectsMap: {
122
+ },
123
+ _objectArraysMap: {
124
+ },
125
+ _behaviorNamesMap: {
126
+ },
127
+ globalVariablesForExtension: runtimeScene.getGame().getVariablesForExtension("VoiceRecognition"),
128
+ sceneVariablesForExtension: runtimeScene.getScene().getVariablesForExtension("VoiceRecognition"),
129
+ localVariables: [],
130
+ getObjects: function(objectName) {
131
+ return eventsFunctionContext._objectArraysMap[objectName] || [];
132
+ },
133
+ getObjectsLists: function(objectName) {
134
+ return eventsFunctionContext._objectsMap[objectName] || null;
135
+ },
136
+ getBehaviorName: function(behaviorName) {
137
+ return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
138
+ },
139
+ createObject: function(objectName) {
140
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
141
+ if (objectsList) {
142
+ const object = parentEventsFunctionContext ?
143
+ parentEventsFunctionContext.createObject(objectsList.firstKey()) :
144
+ runtimeScene.createObject(objectsList.firstKey());
145
+ if (object) {
146
+ objectsList.get(objectsList.firstKey()).push(object);
147
+ eventsFunctionContext._objectArraysMap[objectName].push(object);
148
+ }
149
+ return object; }
150
+ return null;
151
+ },
152
+ getInstancesCountOnScene: function(objectName) {
153
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
154
+ let count = 0;
155
+ if (objectsList) {
156
+ for(const objectName in objectsList.items)
157
+ count += parentEventsFunctionContext ?
158
+ parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
159
+ runtimeScene.getInstancesCountOnScene(objectName);
160
+ }
161
+ return count;
162
+ },
163
+ getLayer: function(layerName) {
164
+ return runtimeScene.getLayer(layerName);
165
+ },
166
+ getArgument: function(argName) {
167
+ return "";
168
+ },
169
+ getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
170
+ };
171
+
172
+
173
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.eventsList0(runtimeScene, eventsFunctionContext);
174
+
175
+
176
+ return;
177
+ }
178
+
179
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.registeredGdjsCallbacks = [];
180
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.registeredGdjsCallbacks.push((runtimeScene) => {
181
+ gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.func(runtimeScene, runtimeScene);
182
+ })
183
+ gdjs.registerFirstRuntimeSceneLoadedCallback(gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.registeredGdjsCallbacks[gdjs.evtsExt__VoiceRecognition__onFirstSceneLoaded.registeredGdjsCallbacks.length - 1]);
gdjs-evtsext__voicerecognition__onsuccess-func.js ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (typeof gdjs.evtsExt__VoiceRecognition__OnSuccess !== "undefined") {
3
+ gdjs.evtsExt__VoiceRecognition__OnSuccess.registeredGdjsCallbacks.forEach(callback =>
4
+ gdjs._unregisterCallback(callback)
5
+ );
6
+ }
7
+
8
+ gdjs.evtsExt__VoiceRecognition__OnSuccess = {};
9
+
10
+
11
+ gdjs.evtsExt__VoiceRecognition__OnSuccess.userFunc0x857568 = function GDJSInlineCode(runtimeScene, eventsFunctionContext) {
12
+ "use strict";
13
+ eventsFunctionContext.returnValue = gdjs._extensionVoiceRecognition.successStatus;
14
+ };
15
+ gdjs.evtsExt__VoiceRecognition__OnSuccess.eventsList0 = function(runtimeScene, eventsFunctionContext) {
16
+
17
+ {
18
+
19
+
20
+ let isConditionTrue_0 = false;
21
+ {
22
+ }
23
+
24
+ }
25
+
26
+
27
+ {
28
+
29
+
30
+ gdjs.evtsExt__VoiceRecognition__OnSuccess.userFunc0x857568(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
31
+
32
+ }
33
+
34
+
35
+ };
36
+
37
+ gdjs.evtsExt__VoiceRecognition__OnSuccess.func = function(runtimeScene, parentEventsFunctionContext) {
38
+ var eventsFunctionContext = {
39
+ _objectsMap: {
40
+ },
41
+ _objectArraysMap: {
42
+ },
43
+ _behaviorNamesMap: {
44
+ },
45
+ globalVariablesForExtension: runtimeScene.getGame().getVariablesForExtension("VoiceRecognition"),
46
+ sceneVariablesForExtension: runtimeScene.getScene().getVariablesForExtension("VoiceRecognition"),
47
+ localVariables: [],
48
+ getObjects: function(objectName) {
49
+ return eventsFunctionContext._objectArraysMap[objectName] || [];
50
+ },
51
+ getObjectsLists: function(objectName) {
52
+ return eventsFunctionContext._objectsMap[objectName] || null;
53
+ },
54
+ getBehaviorName: function(behaviorName) {
55
+ return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
56
+ },
57
+ createObject: function(objectName) {
58
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
59
+ if (objectsList) {
60
+ const object = parentEventsFunctionContext ?
61
+ parentEventsFunctionContext.createObject(objectsList.firstKey()) :
62
+ runtimeScene.createObject(objectsList.firstKey());
63
+ if (object) {
64
+ objectsList.get(objectsList.firstKey()).push(object);
65
+ eventsFunctionContext._objectArraysMap[objectName].push(object);
66
+ }
67
+ return object; }
68
+ return null;
69
+ },
70
+ getInstancesCountOnScene: function(objectName) {
71
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
72
+ let count = 0;
73
+ if (objectsList) {
74
+ for(const objectName in objectsList.items)
75
+ count += parentEventsFunctionContext ?
76
+ parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
77
+ runtimeScene.getInstancesCountOnScene(objectName);
78
+ }
79
+ return count;
80
+ },
81
+ getLayer: function(layerName) {
82
+ return runtimeScene.getLayer(layerName);
83
+ },
84
+ getArgument: function(argName) {
85
+ return "";
86
+ },
87
+ getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
88
+ };
89
+
90
+
91
+ gdjs.evtsExt__VoiceRecognition__OnSuccess.eventsList0(runtimeScene, eventsFunctionContext);
92
+
93
+
94
+ return !!eventsFunctionContext.returnValue;
95
+ }
96
+
97
+ gdjs.evtsExt__VoiceRecognition__OnSuccess.registeredGdjsCallbacks = [];
gdjs-evtsext__voicerecognition__retrieveerror-func.js ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (typeof gdjs.evtsExt__VoiceRecognition__RetrieveError !== "undefined") {
3
+ gdjs.evtsExt__VoiceRecognition__RetrieveError.registeredGdjsCallbacks.forEach(callback =>
4
+ gdjs._unregisterCallback(callback)
5
+ );
6
+ }
7
+
8
+ gdjs.evtsExt__VoiceRecognition__RetrieveError = {};
9
+
10
+
11
+ gdjs.evtsExt__VoiceRecognition__RetrieveError.userFunc0x85fd38 = function GDJSInlineCode(runtimeScene, eventsFunctionContext) {
12
+ "use strict";
13
+ eventsFunctionContext.returnValue = gdjs._extensionVoiceRecognition.getError();
14
+ };
15
+ gdjs.evtsExt__VoiceRecognition__RetrieveError.eventsList0 = function(runtimeScene, eventsFunctionContext) {
16
+
17
+ {
18
+
19
+
20
+ let isConditionTrue_0 = false;
21
+ {
22
+ }
23
+
24
+ }
25
+
26
+
27
+ {
28
+
29
+
30
+ let isConditionTrue_0 = false;
31
+ {
32
+ }
33
+
34
+ }
35
+
36
+
37
+ {
38
+
39
+
40
+ gdjs.evtsExt__VoiceRecognition__RetrieveError.userFunc0x85fd38(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
41
+
42
+ }
43
+
44
+
45
+ };
46
+
47
+ gdjs.evtsExt__VoiceRecognition__RetrieveError.func = function(runtimeScene, parentEventsFunctionContext) {
48
+ var eventsFunctionContext = {
49
+ _objectsMap: {
50
+ },
51
+ _objectArraysMap: {
52
+ },
53
+ _behaviorNamesMap: {
54
+ },
55
+ globalVariablesForExtension: runtimeScene.getGame().getVariablesForExtension("VoiceRecognition"),
56
+ sceneVariablesForExtension: runtimeScene.getScene().getVariablesForExtension("VoiceRecognition"),
57
+ localVariables: [],
58
+ getObjects: function(objectName) {
59
+ return eventsFunctionContext._objectArraysMap[objectName] || [];
60
+ },
61
+ getObjectsLists: function(objectName) {
62
+ return eventsFunctionContext._objectsMap[objectName] || null;
63
+ },
64
+ getBehaviorName: function(behaviorName) {
65
+ return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
66
+ },
67
+ createObject: function(objectName) {
68
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
69
+ if (objectsList) {
70
+ const object = parentEventsFunctionContext ?
71
+ parentEventsFunctionContext.createObject(objectsList.firstKey()) :
72
+ runtimeScene.createObject(objectsList.firstKey());
73
+ if (object) {
74
+ objectsList.get(objectsList.firstKey()).push(object);
75
+ eventsFunctionContext._objectArraysMap[objectName].push(object);
76
+ }
77
+ return object; }
78
+ return null;
79
+ },
80
+ getInstancesCountOnScene: function(objectName) {
81
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
82
+ let count = 0;
83
+ if (objectsList) {
84
+ for(const objectName in objectsList.items)
85
+ count += parentEventsFunctionContext ?
86
+ parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
87
+ runtimeScene.getInstancesCountOnScene(objectName);
88
+ }
89
+ return count;
90
+ },
91
+ getLayer: function(layerName) {
92
+ return runtimeScene.getLayer(layerName);
93
+ },
94
+ getArgument: function(argName) {
95
+ return "";
96
+ },
97
+ getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
98
+ };
99
+
100
+
101
+ gdjs.evtsExt__VoiceRecognition__RetrieveError.eventsList0(runtimeScene, eventsFunctionContext);
102
+
103
+
104
+ return "" + eventsFunctionContext.returnValue;
105
+ }
106
+
107
+ gdjs.evtsExt__VoiceRecognition__RetrieveError.registeredGdjsCallbacks = [];
gdjs-evtsext__voicerecognition__retrievestatus-func.js ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (typeof gdjs.evtsExt__VoiceRecognition__RetrieveStatus !== "undefined") {
3
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus.registeredGdjsCallbacks.forEach(callback =>
4
+ gdjs._unregisterCallback(callback)
5
+ );
6
+ }
7
+
8
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus = {};
9
+
10
+
11
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus.userFunc0x73f000 = function GDJSInlineCode(runtimeScene, eventsFunctionContext) {
12
+ "use strict";
13
+ eventsFunctionContext.returnValue = gdjs._extensionVoiceRecognition.getStatus();
14
+ };
15
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus.eventsList0 = function(runtimeScene, eventsFunctionContext) {
16
+
17
+ {
18
+
19
+
20
+ let isConditionTrue_0 = false;
21
+ {
22
+ }
23
+
24
+ }
25
+
26
+
27
+ {
28
+
29
+
30
+ let isConditionTrue_0 = false;
31
+ {
32
+ }
33
+
34
+ }
35
+
36
+
37
+ {
38
+
39
+
40
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus.userFunc0x73f000(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
41
+
42
+ }
43
+
44
+
45
+ };
46
+
47
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus.func = function(runtimeScene, parentEventsFunctionContext) {
48
+ var eventsFunctionContext = {
49
+ _objectsMap: {
50
+ },
51
+ _objectArraysMap: {
52
+ },
53
+ _behaviorNamesMap: {
54
+ },
55
+ globalVariablesForExtension: runtimeScene.getGame().getVariablesForExtension("VoiceRecognition"),
56
+ sceneVariablesForExtension: runtimeScene.getScene().getVariablesForExtension("VoiceRecognition"),
57
+ localVariables: [],
58
+ getObjects: function(objectName) {
59
+ return eventsFunctionContext._objectArraysMap[objectName] || [];
60
+ },
61
+ getObjectsLists: function(objectName) {
62
+ return eventsFunctionContext._objectsMap[objectName] || null;
63
+ },
64
+ getBehaviorName: function(behaviorName) {
65
+ return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
66
+ },
67
+ createObject: function(objectName) {
68
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
69
+ if (objectsList) {
70
+ const object = parentEventsFunctionContext ?
71
+ parentEventsFunctionContext.createObject(objectsList.firstKey()) :
72
+ runtimeScene.createObject(objectsList.firstKey());
73
+ if (object) {
74
+ objectsList.get(objectsList.firstKey()).push(object);
75
+ eventsFunctionContext._objectArraysMap[objectName].push(object);
76
+ }
77
+ return object; }
78
+ return null;
79
+ },
80
+ getInstancesCountOnScene: function(objectName) {
81
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
82
+ let count = 0;
83
+ if (objectsList) {
84
+ for(const objectName in objectsList.items)
85
+ count += parentEventsFunctionContext ?
86
+ parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
87
+ runtimeScene.getInstancesCountOnScene(objectName);
88
+ }
89
+ return count;
90
+ },
91
+ getLayer: function(layerName) {
92
+ return runtimeScene.getLayer(layerName);
93
+ },
94
+ getArgument: function(argName) {
95
+ return "";
96
+ },
97
+ getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
98
+ };
99
+
100
+
101
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus.eventsList0(runtimeScene, eventsFunctionContext);
102
+
103
+
104
+ return "" + eventsFunctionContext.returnValue;
105
+ }
106
+
107
+ gdjs.evtsExt__VoiceRecognition__RetrieveStatus.registeredGdjsCallbacks = [];
gdjs-evtsext__voicerecognition__retrievetresulttext-func.js ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (typeof gdjs.evtsExt__VoiceRecognition__RetrievetResultText !== "undefined") {
3
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText.registeredGdjsCallbacks.forEach(callback =>
4
+ gdjs._unregisterCallback(callback)
5
+ );
6
+ }
7
+
8
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText = {};
9
+
10
+
11
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText.userFunc0x73c578 = function GDJSInlineCode(runtimeScene, eventsFunctionContext) {
12
+ "use strict";
13
+ eventsFunctionContext.returnValue = gdjs._extensionVoiceRecognition.getResultText();
14
+ };
15
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText.eventsList0 = function(runtimeScene, eventsFunctionContext) {
16
+
17
+ {
18
+
19
+
20
+ let isConditionTrue_0 = false;
21
+ {
22
+ }
23
+
24
+ }
25
+
26
+
27
+ {
28
+
29
+
30
+ let isConditionTrue_0 = false;
31
+ {
32
+ }
33
+
34
+ }
35
+
36
+
37
+ {
38
+
39
+
40
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText.userFunc0x73c578(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
41
+
42
+ }
43
+
44
+
45
+ };
46
+
47
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText.func = function(runtimeScene, parentEventsFunctionContext) {
48
+ var eventsFunctionContext = {
49
+ _objectsMap: {
50
+ },
51
+ _objectArraysMap: {
52
+ },
53
+ _behaviorNamesMap: {
54
+ },
55
+ globalVariablesForExtension: runtimeScene.getGame().getVariablesForExtension("VoiceRecognition"),
56
+ sceneVariablesForExtension: runtimeScene.getScene().getVariablesForExtension("VoiceRecognition"),
57
+ localVariables: [],
58
+ getObjects: function(objectName) {
59
+ return eventsFunctionContext._objectArraysMap[objectName] || [];
60
+ },
61
+ getObjectsLists: function(objectName) {
62
+ return eventsFunctionContext._objectsMap[objectName] || null;
63
+ },
64
+ getBehaviorName: function(behaviorName) {
65
+ return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
66
+ },
67
+ createObject: function(objectName) {
68
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
69
+ if (objectsList) {
70
+ const object = parentEventsFunctionContext ?
71
+ parentEventsFunctionContext.createObject(objectsList.firstKey()) :
72
+ runtimeScene.createObject(objectsList.firstKey());
73
+ if (object) {
74
+ objectsList.get(objectsList.firstKey()).push(object);
75
+ eventsFunctionContext._objectArraysMap[objectName].push(object);
76
+ }
77
+ return object; }
78
+ return null;
79
+ },
80
+ getInstancesCountOnScene: function(objectName) {
81
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
82
+ let count = 0;
83
+ if (objectsList) {
84
+ for(const objectName in objectsList.items)
85
+ count += parentEventsFunctionContext ?
86
+ parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
87
+ runtimeScene.getInstancesCountOnScene(objectName);
88
+ }
89
+ return count;
90
+ },
91
+ getLayer: function(layerName) {
92
+ return runtimeScene.getLayer(layerName);
93
+ },
94
+ getArgument: function(argName) {
95
+ return "";
96
+ },
97
+ getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
98
+ };
99
+
100
+
101
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText.eventsList0(runtimeScene, eventsFunctionContext);
102
+
103
+
104
+ return "" + eventsFunctionContext.returnValue;
105
+ }
106
+
107
+ gdjs.evtsExt__VoiceRecognition__RetrievetResultText.registeredGdjsCallbacks = [];
gdjs-evtsext__voicerecognition__startlistening-func.js ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (typeof gdjs.evtsExt__VoiceRecognition__StartListening !== "undefined") {
3
+ gdjs.evtsExt__VoiceRecognition__StartListening.registeredGdjsCallbacks.forEach(callback =>
4
+ gdjs._unregisterCallback(callback)
5
+ );
6
+ }
7
+
8
+ gdjs.evtsExt__VoiceRecognition__StartListening = {};
9
+
10
+
11
+ gdjs.evtsExt__VoiceRecognition__StartListening.userFunc0x7e6cf8 = function GDJSInlineCode(runtimeScene, eventsFunctionContext) {
12
+ "use strict";
13
+ const Language = eventsFunctionContext.getArgument("language");
14
+
15
+ if(Language.trim() != "") {
16
+ gdjs._extensionVoiceRecognition.setLanguage(Language);
17
+ }
18
+
19
+ gdjs._extensionVoiceRecognition.startListening();
20
+ };
21
+ gdjs.evtsExt__VoiceRecognition__StartListening.eventsList0 = function(runtimeScene, eventsFunctionContext) {
22
+
23
+ {
24
+
25
+
26
+ let isConditionTrue_0 = false;
27
+ {
28
+ }
29
+
30
+ }
31
+
32
+
33
+ {
34
+
35
+
36
+ gdjs.evtsExt__VoiceRecognition__StartListening.userFunc0x7e6cf8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
37
+
38
+ }
39
+
40
+
41
+ };
42
+
43
+ gdjs.evtsExt__VoiceRecognition__StartListening.func = function(runtimeScene, language, parentEventsFunctionContext) {
44
+ var eventsFunctionContext = {
45
+ _objectsMap: {
46
+ },
47
+ _objectArraysMap: {
48
+ },
49
+ _behaviorNamesMap: {
50
+ },
51
+ globalVariablesForExtension: runtimeScene.getGame().getVariablesForExtension("VoiceRecognition"),
52
+ sceneVariablesForExtension: runtimeScene.getScene().getVariablesForExtension("VoiceRecognition"),
53
+ localVariables: [],
54
+ getObjects: function(objectName) {
55
+ return eventsFunctionContext._objectArraysMap[objectName] || [];
56
+ },
57
+ getObjectsLists: function(objectName) {
58
+ return eventsFunctionContext._objectsMap[objectName] || null;
59
+ },
60
+ getBehaviorName: function(behaviorName) {
61
+ return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
62
+ },
63
+ createObject: function(objectName) {
64
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
65
+ if (objectsList) {
66
+ const object = parentEventsFunctionContext ?
67
+ parentEventsFunctionContext.createObject(objectsList.firstKey()) :
68
+ runtimeScene.createObject(objectsList.firstKey());
69
+ if (object) {
70
+ objectsList.get(objectsList.firstKey()).push(object);
71
+ eventsFunctionContext._objectArraysMap[objectName].push(object);
72
+ }
73
+ return object; }
74
+ return null;
75
+ },
76
+ getInstancesCountOnScene: function(objectName) {
77
+ const objectsList = eventsFunctionContext._objectsMap[objectName];
78
+ let count = 0;
79
+ if (objectsList) {
80
+ for(const objectName in objectsList.items)
81
+ count += parentEventsFunctionContext ?
82
+ parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
83
+ runtimeScene.getInstancesCountOnScene(objectName);
84
+ }
85
+ return count;
86
+ },
87
+ getLayer: function(layerName) {
88
+ return runtimeScene.getLayer(layerName);
89
+ },
90
+ getArgument: function(argName) {
91
+ if (argName === "language") return language;
92
+ return "";
93
+ },
94
+ getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
95
+ };
96
+
97
+
98
+ gdjs.evtsExt__VoiceRecognition__StartListening.eventsList0(runtimeScene, eventsFunctionContext);
99
+
100
+
101
+ return;
102
+ }
103
+
104
+ gdjs.evtsExt__VoiceRecognition__StartListening.registeredGdjsCallbacks = [];
howler-sound-manager/howler-sound-manager.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(a){const h=new a.Logger("Audio manager"),f=["audio"],c={preload:!0,onplayerror:(u,e)=>h.error("Can't play an audio file: "+e),onloaderror:(u,e)=>h.error("Error while loading an audio file: "+e)},d=u=>u>1?1:u<0?0:u;class g{constructor(e,s,t,o){this._id=null;this._oncePlay=[];this._onPlay=[];this._howl=e,this._initialVolume=d(s),this._loop=t,this._rate=o}isLoaded(){return this._howl.state()==="loaded"}play(){if(this.isLoaded()){const e=this._howl.play(this._id===null?"__default":this._id);this._id=e,this._howl.volume(this._initialVolume,e),this._howl.loop(this._loop,e),this._howl.rate(a.HowlerSoundManager.clampRate(this._rate),e),this._onPlay.forEach(s=>{this.on("play",s),s(e)}),this._oncePlay.forEach(s=>s(e)),this._onPlay=[],this._oncePlay=[]}else this._howl.once("load",()=>this.play());return this}pause(){return this._id!==null&&this._howl.pause(this._id),this}stop(){return this._id!==null&&this._howl.stop(this._id),this}playing(){return(this._id!==null?this._howl.playing(this._id):!0)||!this.isLoaded()}paused(){return!this.playing()}stopped(){return this.paused()&&this.getSeek()===0}getRate(){return this._rate}setRate(e){return this._rate=e,this._id!==null&&(e=a.HowlerSoundManager.clampRate(e),this._howl.rate(e,this._id)),this}getLoop(){return this._loop}setLoop(e){return this._loop=e,this._id!==null&&this._howl.loop(e,this._id),this}getVolume(){return this._id===null?this._initialVolume:this._howl.volume(this._id)}setVolume(e){return this._initialVolume=d(e),this._id!==null&&this._howl.volume(this._initialVolume,this._id),this}getMute(){return this._id===null?!1:this._howl.mute(this._id)}setMute(e){return this._id!==null&&this._howl.mute(e,this._id),this}getSeek(){return this._id===null?0:this._howl.seek(this._id)}setSeek(e){return this._id!==null&&this._howl.seek(e,this._id),this}getSpatialPosition(e){return this._id===null?0:this._howl.pos(this._id)[e==="x"?0:e==="y"?1:2]}setSpatialPosition(e,s,t){return this._id!==null&&this._howl.pos(e,s,t,this._id),this}fade(e,s,t){return this._id!==null&&this._howl.fade(d(e),d(s),t,this._id),this}on(e,s){return e==="play"?this._id===null?this._onPlay.push(s):this._howl.on(e,s,this._id):this._id===null?this.once("play",()=>this.on(e,s)):this._howl.on(e,s,this._id),this}once(e,s){return e==="play"?this._id===null?this._oncePlay.push(s):this.playing()?s(this._id):this._howl.once(e,s,this._id):this._id===null?this.once("play",()=>this.once(e,s)):this._howl.once(e,s,this._id),this}off(e,s){return this._id!==null&&this._howl.off(e,s,this._id),this}}a.HowlerSound=g;class p{constructor(e){this._loadedMusics=new a.ResourceCache;this._loadedSounds=new a.ResourceCache;this._availableResources={};this._globalVolume=100;this._sounds={};this._musics={};this._freeSounds=[];this._freeMusics=[];this._pausedSounds=[];this._paused=!1;this._getAudioResource=e=>{const s=this._resourceLoader.getResource(e);return s&&this.getResourceKinds().includes(s.kind)?s:{file:e,kind:"audio",metadata:"",name:e}};this._resourceLoader=e;const s=this;document.addEventListener("deviceready",function(){document.addEventListener("pause",function(){const t=s._freeSounds.concat(s._freeMusics);for(let o in s._sounds)s._sounds.hasOwnProperty(o)&&t.push(s._sounds[o]);for(let o in s._musics)s._musics.hasOwnProperty(o)&&t.push(s._musics[o]);for(let o=0;o<t.length;o++){const i=t[o];!i.paused()&&!i.stopped()&&(i.pause(),s._pausedSounds.push(i))}s._paused=!0},!1),document.addEventListener("resume",function(){try{for(let t=0;t<s._pausedSounds.length;t++){const o=s._pausedSounds[t];o.stopped()||o.play()}}catch(t){if(t.message&&typeof t.message=="string"&&t.message.startsWith("Maximum call stack size exceeded"))console.warn("An error occurred when resuming paused sounds while the game was in background:",t);else throw t}s._pausedSounds.length=0,s._paused=!1},!1)})}getResourceKinds(){return f}static clampRate(e){return e>4?4:e<.5?.5:e}_storeSoundInArray(e,s){for(let t=0,o=e.length;t<o;++t)if(!e[t]||e[t].stopped())return e[t]=s,s;return e.push(s),s}createHowlerSound(e,s,t,o,i){const l=s?this._loadedMusics:this._loadedSounds,r=this._getAudioResource(e);let n=l.get(r);if(!n){const _=r?r.file:e;n=new Howl(Object.assign({src:[this._resourceLoader.getFullUrl(_)],html5:s,xhr:{withCredentials:this._resourceLoader.checkIfCredentialsRequired(_)},volume:0},c)),l.set(r,n)}return new a.HowlerSound(n,t,o,i)}loadAudio(e,s){const t=s?this._loadedMusics:this._loadedSounds,o=this._getAudioResource(e);t.get(o)||t.set(o,new Howl(Object.assign({src:[this._resourceLoader.getFullUrl(o.file)],html5:s,xhr:{withCredentials:this._resourceLoader.checkIfCredentialsRequired(o.file)},volume:0},c)))}unloadAudio(e,s){const t=s?this._loadedMusics:this._loadedSounds,o=this._getAudioResource(e),i=t.get(o);if(!i)return;function l(r){for(let n in r)r[n]&&r[n]._howl===i&&(r[n].stop(),delete r[n])}l(this._freeMusics),l(this._freeSounds),l(Object.values(this._musics)),l(Object.values(this._sounds)),l(this._pausedSounds),i.unload(),t.delete(o)}unloadAll(){Howler.unload(),this._freeSounds.length=0,this._freeMusics.length=0,this._sounds={},this._musics={},this._pausedSounds.length=0,this._loadedMusics.clear(),this._loadedSounds.clear()}playSound(e,s,t,o){const i=this.createHowlerSound(e,!1,t/100,s,o);this._storeSoundInArray(this._freeSounds,i),i.once("play",()=>{this._paused&&(i.pause(),this._pausedSounds.push(i))}),i.play()}playSoundOnChannel(e,s,t,o,i){this._sounds[s]&&this._sounds[s].stop();const l=this.createHowlerSound(e,!1,o/100,t,i);this._sounds[s]=l,l.once("play",()=>{this._paused&&(l.pause(),this._pausedSounds.push(l))}),l.play()}getSoundOnChannel(e){return this._sounds[e]||null}playMusic(e,s,t,o){const i=this.createHowlerSound(e,!0,t/100,s,o);this._storeSoundInArray(this._freeMusics,i),i.once("play",()=>{this._paused&&(i.pause(),this._pausedSounds.push(i))}),i.play()}playMusicOnChannel(e,s,t,o,i){this._musics[s]&&this._musics[s].stop();const l=this.createHowlerSound(e,!0,o/100,t,i);this._musics[s]=l,l.once("play",()=>{this._paused&&(l.pause(),this._pausedSounds.push(l))}),l.play()}getMusicOnChannel(e){return this._musics[e]||null}setGlobalVolume(e){this._globalVolume=e,this._globalVolume>100&&(this._globalVolume=100),this._globalVolume<0&&(this._globalVolume=0),Howler.volume(this._globalVolume/100)}getGlobalVolume(){return this._globalVolume}clearAll(){Howler.stop(),this._freeSounds.length=0,this._freeMusics.length=0,this._sounds={},this._musics={},this._pausedSounds.length=0}async processResource(e){}async loadResource(e){const s=this._resourceLoader.getResource(e);if(!s){h.warn('Unable to find audio for resource "'+e+'".');return}if(s.file){if(this._availableResources[s.name])return;this._availableResources[s.name]=s}const t=(i,l)=>new Promise((r,n)=>{const _=l?this._loadedMusics:this._loadedSounds;_[i]=new Howl(Object.assign({},c,{src:[this._resourceLoader.getFullUrl(i)],onload:r,onloaderror:(y,w)=>n(w),html5:l,xhr:{withCredentials:this._resourceLoader.checkIfCredentialsRequired(i)},volume:0}))}),o=s.file;if(s.preloadAsMusic)try{await t(o,!0)}catch(i){h.warn("There was an error while preloading an audio file: "+i)}if(s.preloadAsSound)try{await t(o,!1)}catch(i){h.warn("There was an error while preloading an audio file: "+i)}else if(s.preloadInCache||!s.preloadAsMusic)try{await new Promise((i,l)=>{const r=new XMLHttpRequest;r.withCredentials=this._resourceLoader.checkIfCredentialsRequired(o),r.addEventListener("load",i),r.addEventListener("error",n=>l("XHR error: "+o)),r.addEventListener("abort",n=>l("XHR abort: "+o)),r.open("GET",this._resourceLoader.getFullUrl(o)),r.send()})}catch(i){h.warn("There was an error while preloading an audio file: "+i)}}dispose(){this.unloadAll()}}a.HowlerSoundManager=p,a.SoundManager=p})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=howler-sound-manager.js.map
howler-sound-manager/howler.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ /*! howler.js v2.2.3 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */
2
+ /* Modified for GDevelop by reverting commit 0323af9b843351cacc47893aed8e65cd8ba3b0cb to fix https://github.com/goldfire/howler.js/issues/1603 */
3
+ !function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.volume=u._volume*e)}return o}return o._volume},mute:function(e){var o=this||n;o.ctx||_(),o._muted=e,o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e?0:o._volume,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.muted=!!e||u._muted)}return o},stop:function(){for(var e=this||n,o=0;o<e._howls.length;o++)e._howls[o].stop();return e},unload:function(){for(var e=this||n,o=e._howls.length-1;o>=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/([0-6].)/g),u=a&&parseInt(a[0].split("/")[1],10)<33,d=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),i=r.match(/Version\/(.*?) /),_=d&&i&&parseInt(i[1],10)<15;return e._codecs={mp3:!(u||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(o.canPlayType('audio/wav; codecs="1"')||o.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(o.canPlayType("audio/x-m4b;")||o.canPlayType("audio/m4b;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var o=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var t=new Audio;t._unlocked=!0,e._releaseHtml5Audio(t)}catch(n){e.noAudio=!0;break}for(var r=0;r<e._howls.length;r++)if(!e._howls[r]._webAudio)for(var a=e._howls[r]._getSoundIds(),u=0;u<a.length;u++){var d=e._howls[r]._soundById(a[u]);d&&d._node&&!d._node._unlocked&&(d._node._unlocked=!0,d._node.load())}e._autoResume();var i=e.ctx.createBufferSource();i.buffer=e._scratchBuffer,i.connect(e.ctx.destination),void 0===i.start?i.noteOn(0):i.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),i.onended=function(){i.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",o,!0),document.removeEventListener("touchend",o,!0),document.removeEventListener("click",o,!0),document.removeEventListener("keydown",o,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",o,!0),document.addEventListener("touchend",o,!0),document.addEventListener("click",o,!0),document.addEventListener("keydown",o,!0),e}},_obtainHtml5Audio:function(){var e=this||n;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var o=(new Audio).play();return o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)&&o.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(e){var o=this||n;return e._unlocked&&o._html5AudioPool.push(e),o},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&n.usingWebAudio){for(var o=0;o<e._howls.length;o++)if(e._howls[o]._webAudio)for(var t=0;t<e._howls[o]._sounds.length;t++)if(!e._howls[o]._sounds[t]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout(function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var n=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(n,n)}},3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&n.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then(function(){e.state="running";for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("resume")}),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var n=new e,o=function(e){var n=this;if(!e.src||0===e.src.length)return void console.error("An array of source files must be passed with any new Howl.");n.init(e)};o.prototype={init:function(e){var o=this;return n.ctx||_(),o._autoplay=e.autoplay||!1,o._format="string"!=typeof e.format?e.format:[e.format],o._html5=e.html5||!1,o._muted=e.mute||!1,o._loop=e.loop||!1,o._pool=e.pool||5,o._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,o._rate=e.rate||1,o._sprite=e.sprite||{},o._src="string"!=typeof e.src?e.src:[e.src],o._volume=void 0!==e.volume?e.volume:1,o._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},o._duration=0,o._state="unloaded",o._sounds=[],o._endTimers={},o._queue=[],o._playLock=!1,o._onend=e.onend?[{fn:e.onend}]:[],o._onfade=e.onfade?[{fn:e.onfade}]:[],o._onload=e.onload?[{fn:e.onload}]:[],o._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],o._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],o._onpause=e.onpause?[{fn:e.onpause}]:[],o._onplay=e.onplay?[{fn:e.onplay}]:[],o._onstop=e.onstop?[{fn:e.onstop}]:[],o._onmute=e.onmute?[{fn:e.onmute}]:[],o._onvolume=e.onvolume?[{fn:e.onvolume}]:[],o._onrate=e.onrate?[{fn:e.onrate}]:[],o._onseek=e.onseek?[{fn:e.onseek}]:[],o._onunlock=e.onunlock?[{fn:e.onunlock}]:[],o._onresume=[],o._webAudio=n.usingWebAudio&&!o._html5,void 0!==n.ctx&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(o),o._autoplay&&o._queue.push({event:"play",action:function(){o.play()}}),o._preload&&"none"!==o._preload&&o.load(),o},load:function(){var e=this,o=null;if(n.noAudio)return void e._emit("loaderror",null,"No audio support.");"string"==typeof e._src&&(e._src=[e._src]);for(var r=0;r<e._src.length;r++){var u,d;if(e._format&&e._format[r])u=e._format[r];else{if("string"!=typeof(d=e._src[r])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}u=/^data:audio\/([^;,]+);/i.exec(d),u||(u=/\.([^.]+)$/.exec(d.split("?",1)[0])),u&&(u=u[1].toLowerCase())}if(u||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),u&&n.codecs(u)){o=e._src[r];break}}return o?(e._src=o,e._state="loading","https:"===window.location.protocol&&"http:"===o.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new t(e),e._webAudio&&a(e),e):void e._emit("loaderror",null,"No codec support for selected audio sources.")},play:function(e,o){var t=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===t._state&&!t._sprite[e])return null;if(void 0===e&&(e="__default",!t._playLock)){for(var a=0,u=0;u<t._sounds.length;u++)t._sounds[u]._paused&&!t._sounds[u]._ended&&(a++,r=t._sounds[u]._id);1===a?e=null:r=null}}var d=r?t._soundById(r):t._inactiveSound();if(!d)return null;if(r&&!e&&(e=d._sprite||"__default"),"loaded"!==t._state){d._sprite=e,d._ended=!1;var i=d._id;return t._queue.push({event:"play",action:function(){t.play(i)}}),i}if(r&&!d._paused)return o||t._loadQueue("play"),d._id;t._webAudio&&n._autoResume();var _=Math.max(0,d._seek>0?d._seek:t._sprite[e][0]/1e3),s=Math.max(0,(t._sprite[e][0]+t._sprite[e][1])/1e3-_),l=1e3*s/Math.abs(d._rate),c=t._sprite[e][0]/1e3,f=(t._sprite[e][0]+t._sprite[e][1])/1e3;d._sprite=e,d._ended=!1;var p=function(){d._paused=!1,d._seek=_,d._start=c,d._stop=f,d._loop=!(!d._loop&&!t._sprite[e][2])};if(_>=f)return void t._ended(d);var m=d._node;if(t._webAudio){var v=function(){t._playLock=!1,p(),t._refreshBuffer(d);var e=d._muted||t._muted?0:d._volume;m.gain.setValueAtTime(e,n.ctx.currentTime),d._playStart=n.ctx.currentTime,void 0===m.bufferSource.start?d._loop?m.bufferSource.noteGrainOn(0,_,86400):m.bufferSource.noteGrainOn(0,_,s):d._loop?m.bufferSource.start(0,_,86400):m.bufferSource.start(0,_,s),l!==1/0&&(t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l)),o||setTimeout(function(){t._emit("play",d._id),t._loadQueue()},0)};"running"===n.state&&"interrupted"!==n.ctx.state?v():(t._playLock=!0,t.once("resume",v),t._clearTimer(d._id))}else{var h=function(){m.currentTime=_,m.muted=d._muted||t._muted||n._muted||m.muted,m.volume=d._volume*n.volume(),m.playbackRate=d._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(t._playLock=!0,p(),r.then(function(){t._playLock=!1,m._unlocked=!0,o||(t._emit("play",d._id),t._loadQueue())}).catch(function(){t._playLock=!1,t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),d._ended=!0,d._paused=!0})):o||(t._playLock=!1,p(),t._emit("play",d._id),t._loadQueue()),m.playbackRate=d._rate,m.paused)return void t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||d._loop?t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l):(t._endTimers[d._id]=function(){t._ended(d),m.removeEventListener("ended",t._endTimers[d._id],!1)},m.addEventListener("ended",t._endTimers[d._id],!1))}catch(e){t._emit("playerror",d._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=t._src,m.load());var y=window&&window.ejecta||!m.readyState&&n._navigator.isCocoonJS;if(m.readyState>=3||y)h();else{t._playLock=!0,t._state="loading";var g=function(){t._state="loaded",h(),m.removeEventListener(n._canPlayEvent,g,!1)};m.addEventListener(n._canPlayEvent,g,!1),t._clearTimer(d._id)}}return d._id},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var o=n._getSoundIds(e),t=0;t<o.length;t++){n._clearTimer(o[t]);var r=n._soundById(o[t]);if(r&&!r._paused&&(r._seek=n.seek(o[t]),r._rateSeek=0,r._paused=!0,n._stopFade(o[t]),r._node))if(n._webAudio){if(!r._node.bufferSource)continue;void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),n._cleanBuffer(r._node)}else isNaN(r._node.duration)&&r._node.duration!==1/0||r._node.pause();arguments[1]||n._emit("pause",r?r._id:null)}return n},stop:function(e,n){var o=this;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"stop",action:function(){o.stop(e)}}),o;for(var t=o._getSoundIds(e),r=0;r<t.length;r++){o._clearTimer(t[r]);var a=o._soundById(t[r]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,o._stopFade(t[r]),a._node&&(o._webAudio?a._node.bufferSource&&(void 0===a._node.bufferSource.stop?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),o._cleanBuffer(a._node)):isNaN(a._node.duration)&&a._node.duration!==1/0||(a._node.currentTime=a._start||0,a._node.pause(),a._node.duration===1/0&&o._clearSound(a._node))),n||o._emit("stop",a._id))}return o},mute:function(e,o){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"mute",action:function(){t.mute(e,o)}}),t;if(void 0===o){if("boolean"!=typeof e)return t._muted;t._muted=e}for(var r=t._getSoundIds(o),a=0;a<r.length;a++){var u=t._soundById(r[a]);u&&(u._muted=e,u._interval&&t._stopFade(u._id),t._webAudio&&u._node?u._node.gain.setValueAtTime(e?0:u._volume,n.ctx.currentTime):u._node&&(u._node.muted=!!n._muted||e),t._emit("mute",u._id))}return t},volume:function(){var e,o,t=this,r=arguments;if(0===r.length)return t._volume;if(1===r.length||2===r.length&&void 0===r[1]){t._getSoundIds().indexOf(r[0])>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else r.length>=2&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var a;if(!(void 0!==e&&e>=0&&e<=1))return a=o?t._soundById(o):t._sounds[0],a?a._volume:0;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,r)}}),t;void 0===o&&(t._volume=e),o=t._getSoundIds(o);for(var u=0;u<o.length;u++)(a=t._soundById(o[u]))&&(a._volume=e,r[2]||t._stopFade(o[u]),t._webAudio&&a._node&&!a._muted?a._node.gain.setValueAtTime(e,n.ctx.currentTime):a._node&&!a._muted&&(a._node.volume=e*n.volume()),t._emit("volume",a._id));return t},fade:function(e,o,t,r){var a=this;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"fade",action:function(){a.fade(e,o,t,r)}}),a;e=Math.min(Math.max(0,parseFloat(e)),1),o=Math.min(Math.max(0,parseFloat(o)),1),t=parseFloat(t),a.volume(e,r);for(var u=a._getSoundIds(r),d=0;d<u.length;d++){var i=a._soundById(u[d]);if(i){if(r||a._stopFade(u[d]),a._webAudio&&!i._muted){var _=n.ctx.currentTime,s=_+t/1e3;i._volume=e,i._node.gain.setValueAtTime(e,_),i._node.gain.linearRampToValueAtTime(o,s)}a._startFadeInterval(i,e,o,t,u[d],void 0===r)}}return a},_startFadeInterval:function(e,n,o,t,r,a){var u=this,d=n,i=o-n,_=Math.abs(i/.01),s=Math.max(4,_>0?t/_:t),l=Date.now();e._fadeTo=o,e._interval=setInterval(function(){var r=(Date.now()-l)/t;l=Date.now(),d+=i*r,d=Math.round(100*d)/100,d=i<0?Math.max(o,d):Math.min(o,d),u._webAudio?e._volume=d:u.volume(d,e._id,!0),a&&(u._volume=d),(o<n&&d<=o||o>n&&d>=o)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,u.volume(o,e._id),u._emit("fade",e._id))},s)},_stopFade:function(e){var o=this,t=o._soundById(e);return t&&t._interval&&(o._webAudio&&t._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(t._interval),t._interval=null,o.volume(t._fadeTo,e),t._fadeTo=null,o._emit("fade",e)),o},loop:function(){var e,n,o,t=this,r=arguments;if(0===r.length)return t._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(o=t._soundById(parseInt(r[0],10)))&&o._loop;e=r[0],t._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var a=t._getSoundIds(n),u=0;u<a.length;u++)(o=t._soundById(a[u]))&&(o._loop=e,t._webAudio&&o._node&&o._node.bufferSource&&(o._node.bufferSource.loop=e,e&&(o._node.bufferSource.loopStart=o._start||0,o._node.bufferSource.loopEnd=o._stop,t.playing(a[u])&&(t.pause(a[u],!0),t.play(a[u],!0)))));return t},rate:function(){var e,o,t=this,r=arguments;if(0===r.length)o=t._sounds[0]._id;else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var d;if("number"!=typeof e)return d=t._soundById(o),d?d._rate:t._rate;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,r)}}),t;void 0===o&&(t._rate=e),o=t._getSoundIds(o);for(var i=0;i<o.length;i++)if(d=t._soundById(o[i])){t.playing(o[i])&&(d._rateSeek=t.seek(o[i]),d._playStart=t._webAudio?n.ctx.currentTime:d._playStart),d._rate=e,t._webAudio&&d._node&&d._node.bufferSource?d._node.bufferSource.playbackRate.setValueAtTime(e,n.ctx.currentTime):d._node&&(d._node.playbackRate=e);var _=t.seek(o[i]),s=(t._sprite[d._sprite][0]+t._sprite[d._sprite][1])/1e3-_,l=1e3*s/Math.abs(d._rate);!t._endTimers[o[i]]&&d._paused||(t._clearTimer(o[i]),t._endTimers[o[i]]=setTimeout(t._ended.bind(t,d),l)),t._emit("rate",d._id)}return t},seek:function(){var e,o,t=this,r=arguments;if(0===r.length)t._sounds.length&&(o=t._sounds[0]._id);else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):t._sounds.length&&(o=t._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));if(void 0===o)return 0;if("number"==typeof e&&("loaded"!==t._state||t._playLock))return t._queue.push({event:"seek",action:function(){t.seek.apply(t,r)}}),t;var d=t._soundById(o);if(d){if(!("number"==typeof e&&e>=0)){if(t._webAudio){var i=t.playing(o)?n.ctx.currentTime-d._playStart:0,_=d._rateSeek?d._rateSeek-d._seek:0;return d._seek+(_+i*Math.abs(d._rate))}return d._node.currentTime}var s=t.playing(o);s&&t.pause(o,!0),d._seek=e,d._ended=!1,t._clearTimer(o),t._webAudio||!d._node||isNaN(d._node.duration)||(d._node.currentTime=e);var l=function(){t._emit("seek",o),s&&t.play(o,!0)};if(s&&!t._webAudio){var c=function(){t._playLock?setTimeout(c,0):l()};setTimeout(c,0)}else l()}return t},playing:function(e){var n=this;if("number"==typeof e){var o=n._soundById(e);return!!o&&!o._paused}for(var t=0;t<n._sounds.length;t++)if(!n._sounds[t]._paused)return!0;return!1},duration:function(e){var n=this,o=n._duration,t=n._soundById(e);return t&&(o=n._sprite[t._sprite][1]/1e3),o},state:function(){return this._state},unload:function(){for(var e=this,o=e._sounds,t=0;t<o.length;t++)o[t]._paused||e.stop(o[t]._id),e._webAudio||(e._clearSound(o[t]._node),o[t]._node.removeEventListener("error",o[t]._errorFn,!1),o[t]._node.removeEventListener(n._canPlayEvent,o[t]._loadFn,!1),o[t]._node.removeEventListener("ended",o[t]._endFn,!1),n._releaseHtml5Audio(o[t]._node)),delete o[t]._node,e._clearTimer(o[t]._id);var a=n._howls.indexOf(e);a>=0&&n._howls.splice(a,1);var u=!0;for(t=0;t<n._howls.length;t++)if(n._howls[t]._src===e._src||e._src.indexOf(n._howls[t]._src)>=0){u=!1;break}return r&&u&&delete r[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,o,t){var r=this,a=r["_on"+e];return"function"==typeof n&&a.push(t?{id:o,fn:n,once:t}:{id:o,fn:n}),r},off:function(e,n,o){var t=this,r=t["_on"+e],a=0;if("number"==typeof n&&(o=n,n=null),n||o)for(a=0;a<r.length;a++){var u=o===r[a].id;if(n===r[a].fn&&u||!n&&u){r.splice(a,1);break}}else if(e)t["_on"+e]=[];else{var d=Object.keys(t);for(a=0;a<d.length;a++)0===d[a].indexOf("_on")&&Array.isArray(t[d[a]])&&(t[d[a]]=[])}return t},once:function(e,n,o){var t=this;return t.on(e,n,o,1),t},_emit:function(e,n,o){for(var t=this,r=t["_on"+e],a=r.length-1;a>=0;a--)r[a].id&&r[a].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,o)}.bind(t,r[a].fn),0),r[a].once&&t.off(e,r[a].fn,r[a].id));return t._loadQueue(e),t},_loadQueue:function(e){var n=this;if(n._queue.length>0){var o=n._queue[0];o.event===e&&(n._queue.shift(),n._loadQueue()),e||o.action()}return n},_ended:function(e){var o=this,t=e._sprite;if(!o._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(o._ended.bind(o,e),100),o;var r=!(!e._loop&&!o._sprite[t][2]);if(o._emit("end",e._id),!o._webAudio&&r&&o.stop(e._id,!0).play(e._id),o._webAudio&&r){o._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=n.ctx.currentTime;var a=1e3*(e._stop-e._start)/Math.abs(e._rate);o._endTimers[e._id]=setTimeout(o._ended.bind(o,e),a)}return o._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,o._clearTimer(e._id),o._cleanBuffer(e._node),n._autoSuspend()),o._webAudio||r||o.stop(e._id,!0),o},_clearTimer:function(e){var n=this;if(n._endTimers[e]){if("function"!=typeof n._endTimers[e])clearTimeout(n._endTimers[e]);else{var o=n._soundById(e);o&&o._node&&o._node.removeEventListener("ended",n._endTimers[e],!1)}delete n._endTimers[e]}return n},_soundById:function(e){for(var n=this,o=0;o<n._sounds.length;o++)if(e===n._sounds[o]._id)return n._sounds[o];return null},_inactiveSound:function(){var e=this;e._drain();for(var n=0;n<e._sounds.length;n++)if(e._sounds[n]._ended)return e._sounds[n].reset();return new t(e)},_drain:function(){var e=this,n=e._pool,o=0,t=0;if(!(e._sounds.length<n)){for(t=0;t<e._sounds.length;t++)e._sounds[t]._ended&&o++;for(t=e._sounds.length-1;t>=0;t--){if(o<=n)return;e._sounds[t]._ended&&(e._webAudio&&e._sounds[t]._node&&e._sounds[t]._node.disconnect(0),e._sounds.splice(t,1),o--)}}},_getSoundIds:function(e){var n=this;if(void 0===e){for(var o=[],t=0;t<n._sounds.length;t++)o.push(n._sounds[t]._id);return o}return[e]},_refreshBuffer:function(e){var o=this;return e._node.bufferSource=n.ctx.createBufferSource(),e._node.bufferSource.buffer=r[o._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,n.ctx.currentTime),o},_cleanBuffer:function(e){var o=this,t=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,o},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(e){this._parent=e,this.init()};t.prototype={init:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,o._sounds.push(e),e.create(),e},create:function(){var e=this,o=e._parent,t=n._muted||e._muted||e._parent._muted?0:e._volume;return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=o._src,e._node.preload=!0===o._preload?"auto":o._preload,e._node.volume=t*n.volume(),e._node.load()),e},reset:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,o=e._parent;o._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(o._sprite).length&&(o._sprite={__default:[0,1e3*o._duration]}),"loaded"!==o._state&&(o._state="loaded",o._emit("load"),o._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,n=e._parent;n._duration===1/0&&(n._duration=Math.ceil(10*e._node.duration)/10,n._sprite.__default[1]===1/0&&(n._sprite.__default[1]=1e3*n._duration),n._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var r={},a=function(e){var n=e._src;if(r[n])return e._duration=r[n].duration,void i(e);if(/^data:[^;]+;base64,/.test(n)){for(var o=atob(n.split(",")[1]),t=new Uint8Array(o.length),a=0;a<o.length;++a)t[a]=o.charCodeAt(a);d(t.buffer,e)}else{var _=new XMLHttpRequest;_.open(e._xhr.method,n,!0),_.withCredentials=e._xhr.withCredentials,_.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach(function(n){_.setRequestHeader(n,e._xhr.headers[n])}),_.onload=function(){var n=(_.status+"")[0];if("0"!==n&&"2"!==n&&"3"!==n)return void e._emit("loaderror",null,"Failed loading audio file with status: "+_.status+".");d(_.response,e)},_.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete r[n],e.load())},u(_)}},u=function(e){try{e.send()}catch(n){e.onerror()}},d=function(e,o){var t=function(){o._emit("loaderror",null,"Decoding audio data failed.")},a=function(e){e&&o._sounds.length>0?(r[o._src]=e,i(o,e)):t()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(t):n.ctx.decodeAudioData(e,a,t)},i=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},_=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),o=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=o?parseInt(o[1],10):null;if(e&&t&&t<9){var r=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!r&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:n,Howl:o}}),"undefined"!=typeof exports&&(exports.Howler=n,exports.Howl=o),"undefined"!=typeof global?(global.HowlerGlobal=e,global.Howler=n,global.Howl=o,global.Sound=t):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=o,window.Sound=t)}();
index.html CHANGED
@@ -1,19 +1,135 @@
1
- <!doctype html>
2
  <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
  <html>
3
+ <head>
4
+ <meta charset="UTF-8"/>
5
+ <link rel="manifest" href="manifest.webmanifest">
6
+
7
+ <meta name="apple-mobile-web-app-capable" content="yes">
8
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
9
+
10
+ <meta name="theme-color" content="#000000" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
12
+
13
+ <style>
14
+ body {
15
+ margin: 0;
16
+ padding: 0;
17
+ background-color: #000000;
18
+ overflow: hidden;
19
+ }
20
+ #canvasArea {
21
+ margin-left: auto;
22
+ margin-right: auto;
23
+ overflow: hidden;
24
+ }
25
+
26
+
27
+ </style>
28
+ <!-- Libs and GDJS core files : -->
29
+ <script src="libs/jshashtable.js" crossorigin="anonymous"></script>
30
+ <script src="logger.js" crossorigin="anonymous"></script>
31
+ <script src="gd.js" crossorigin="anonymous"></script>
32
+ <script src="libs/rbush.js" crossorigin="anonymous"></script>
33
+ <script src="AsyncTasksManager.js" crossorigin="anonymous"></script>
34
+ <script src="inputmanager.js" crossorigin="anonymous"></script>
35
+ <script src="jsonmanager.js" crossorigin="anonymous"></script>
36
+ <script src="Model3DManager.js" crossorigin="anonymous"></script>
37
+ <script src="ResourceLoader.js" crossorigin="anonymous"></script>
38
+ <script src="ResourceCache.js" crossorigin="anonymous"></script>
39
+ <script src="timemanager.js" crossorigin="anonymous"></script>
40
+ <script src="polygon.js" crossorigin="anonymous"></script>
41
+ <script src="runtimeobject.js" crossorigin="anonymous"></script>
42
+ <script src="profiler.js" crossorigin="anonymous"></script>
43
+ <script src="RuntimeInstanceContainer.js" crossorigin="anonymous"></script>
44
+ <script src="runtimescene.js" crossorigin="anonymous"></script>
45
+ <script src="scenestack.js" crossorigin="anonymous"></script>
46
+ <script src="force.js" crossorigin="anonymous"></script>
47
+ <script src="RuntimeLayer.js" crossorigin="anonymous"></script>
48
+ <script src="layer.js" crossorigin="anonymous"></script>
49
+ <script src="RuntimeCustomObjectLayer.js" crossorigin="anonymous"></script>
50
+ <script src="timer.js" crossorigin="anonymous"></script>
51
+ <script src="runtimewatermark.js" crossorigin="anonymous"></script>
52
+ <script src="runtimegame.js" crossorigin="anonymous"></script>
53
+ <script src="variable.js" crossorigin="anonymous"></script>
54
+ <script src="variablescontainer.js" crossorigin="anonymous"></script>
55
+ <script src="oncetriggers.js" crossorigin="anonymous"></script>
56
+ <script src="runtimebehavior.js" crossorigin="anonymous"></script>
57
+ <script src="SpriteAnimator.js" crossorigin="anonymous"></script>
58
+ <script src="spriteruntimeobject.js" crossorigin="anonymous"></script>
59
+ <script src="affinetransformation.js" crossorigin="anonymous"></script>
60
+ <script src="CustomRuntimeObjectInstanceContainer.js" crossorigin="anonymous"></script>
61
+ <script src="CustomRuntimeObject.js" crossorigin="anonymous"></script>
62
+ <script src="CustomRuntimeObject2D.js" crossorigin="anonymous"></script>
63
+ <script src="events-tools/commontools.js" crossorigin="anonymous"></script>
64
+ <script src="events-tools/variabletools.js" crossorigin="anonymous"></script>
65
+ <script src="events-tools/runtimescenetools.js" crossorigin="anonymous"></script>
66
+ <script src="events-tools/inputtools.js" crossorigin="anonymous"></script>
67
+ <script src="events-tools/objecttools.js" crossorigin="anonymous"></script>
68
+ <script src="events-tools/cameratools.js" crossorigin="anonymous"></script>
69
+ <script src="events-tools/soundtools.js" crossorigin="anonymous"></script>
70
+ <script src="events-tools/storagetools.js" crossorigin="anonymous"></script>
71
+ <script src="events-tools/stringtools.js" crossorigin="anonymous"></script>
72
+ <script src="events-tools/windowtools.js" crossorigin="anonymous"></script>
73
+ <script src="events-tools/networktools.js" crossorigin="anonymous"></script>
74
+ <script src="splash/gd-logo-light.js" crossorigin="anonymous"></script>
75
+ <script src="pixi-renderers/pixi.js" crossorigin="anonymous"></script>
76
+ <script src="pixi-renderers/pixi-filters-tools.js" crossorigin="anonymous"></script>
77
+ <script src="pixi-renderers/runtimegame-pixi-renderer.js" crossorigin="anonymous"></script>
78
+ <script src="pixi-renderers/runtimescene-pixi-renderer.js" crossorigin="anonymous"></script>
79
+ <script src="pixi-renderers/layer-pixi-renderer.js" crossorigin="anonymous"></script>
80
+ <script src="pixi-renderers/pixi-image-manager.js" crossorigin="anonymous"></script>
81
+ <script src="pixi-renderers/pixi-bitmapfont-manager.js" crossorigin="anonymous"></script>
82
+ <script src="pixi-renderers/spriteruntimeobject-pixi-renderer.js" crossorigin="anonymous"></script>
83
+ <script src="pixi-renderers/CustomRuntimeObject2DPixiRenderer.js" crossorigin="anonymous"></script>
84
+ <script src="pixi-renderers/DebuggerPixiRenderer.js" crossorigin="anonymous"></script>
85
+ <script src="pixi-renderers/loadingscreen-pixi-renderer.js" crossorigin="anonymous"></script>
86
+ <script src="pixi-renderers/pixi-effects-manager.js" crossorigin="anonymous"></script>
87
+ <script src="howler-sound-manager/howler.min.js" crossorigin="anonymous"></script>
88
+ <script src="howler-sound-manager/howler-sound-manager.js" crossorigin="anonymous"></script>
89
+ <script src="fontfaceobserver-font-manager/fontfaceobserver.js" crossorigin="anonymous"></script>
90
+ <script src="fontfaceobserver-font-manager/fontfaceobserver-font-manager.js" crossorigin="anonymous"></script>
91
+ <script src="Extensions/TextObject/textruntimeobject-pixi-renderer.js" crossorigin="anonymous"></script>
92
+ <script src="Extensions/TextObject/textruntimeobject.js" crossorigin="anonymous"></script>
93
+ <script src="gdjs-evtsext__voicerecognition__onerror-func.js" crossorigin="anonymous"></script>
94
+ <script src="gdjs-evtsext__voicerecognition__onfirstsceneloaded-func.js" crossorigin="anonymous"></script>
95
+ <script src="gdjs-evtsext__voicerecognition__onsuccess-func.js" crossorigin="anonymous"></script>
96
+ <script src="gdjs-evtsext__voicerecognition__retrieveerror-func.js" crossorigin="anonymous"></script>
97
+ <script src="gdjs-evtsext__voicerecognition__retrievestatus-func.js" crossorigin="anonymous"></script>
98
+ <script src="gdjs-evtsext__voicerecognition__retrievetresulttext-func.js" crossorigin="anonymous"></script>
99
+ <script src="gdjs-evtsext__voicerecognition__startlistening-func.js" crossorigin="anonymous"></script>
100
+ <script src="object-capabilities/AnimatableBehavior.js" crossorigin="anonymous"></script>
101
+ <script src="object-capabilities/EffectBehavior.js" crossorigin="anonymous"></script>
102
+ <script src="object-capabilities/FlippableBehavior.js" crossorigin="anonymous"></script>
103
+ <script src="object-capabilities/OpacityBehavior.js" crossorigin="anonymous"></script>
104
+ <script src="object-capabilities/ResizableBehavior.js" crossorigin="anonymous"></script>
105
+ <script src="object-capabilities/ScalableBehavior.js" crossorigin="anonymous"></script>
106
+ <script src="object-capabilities/TextContainerBehavior.js" crossorigin="anonymous"></script>
107
+ <script src="code0.js" crossorigin="anonymous"></script>
108
+ <script src="data.js" crossorigin="anonymous"></script>
109
+
110
+
111
+ </head>
112
+ <body>
113
+
114
+
115
+ <script>
116
+
117
+ (function() {
118
+ //Initialization
119
+ var game = new gdjs.RuntimeGame(gdjs.projectData, {});
120
+
121
+ //Create a renderer
122
+ game.getRenderer().createStandardCanvas(document.body);
123
+
124
+ //Bind keyboards/mouse/touch events
125
+ game.getRenderer().bindStandardEvents(game.getInputManager(), window, document);
126
+
127
+ //Load all assets and start the game
128
+ game.loadAllAssets(function() {
129
+ game.startGameLoop();
130
+ });
131
+ })();
132
+
133
+ </script>
134
+ </body>
135
  </html>
inputmanager.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(i){const o=class{constructor(){this._lastPressedKey=0;this._cursorX=0;this._cursorY=0;this._mouseX=0;this._mouseY=0;this._isMouseInsideCanvas=!0;this._mouseWheelDelta=0;this._touches={firstKey:()=>{for(const e in this._mouseOrTouches.items)if(e!=="1")return e;return null}};this._startedTouches=[];this._endedTouches=[];this._touchSimulateMouse=!0;this._lastStartedTouchIndex=0;this._lastEndedTouchIndex=0;this._pressedKeys=new Hashtable,this._releasedKeys=new Hashtable,this._pressedMouseButtons=new Array(5),this._releasedMouseButtons=new Array(5),this._mouseOrTouches=new Hashtable}_getLocationAwareKeyCode(e,s){return s?96<=e&&e<=105?e:e+1e3*s:o._DEFAULT_LEFT_VARIANT_KEYS.indexOf(e)!==-1?e+1e3:e}onKeyPressed(e,s){const t=this._getLocationAwareKeyCode(e,s);this._pressedKeys.put(t,!0),this._lastPressedKey=t}onKeyReleased(e,s){const t=this._getLocationAwareKeyCode(e,s);this._pressedKeys.put(t,!1),this._releasedKeys.put(t,!0)}getLastPressedKey(){return this._lastPressedKey}isKeyPressed(e){return this._pressedKeys.containsKey(e)&&this._pressedKeys.get(e)}wasKeyReleased(e){return this._releasedKeys.containsKey(e)&&this._releasedKeys.get(e)}anyKeyPressed(){for(const e in this._pressedKeys.items)if(this._pressedKeys.items.hasOwnProperty(e)&&this._pressedKeys.items[e])return!0;return!1}anyKeyReleased(){for(const e in this._releasedKeys.items)if(this._releasedKeys.items.hasOwnProperty(e)&&this._releasedKeys.items[e])return!0;return!1}onMouseMove(e,s){this._setCursorPosition(e,s),this._mouseX=e,this._mouseY=s,this.isMouseButtonPressed(o.MOUSE_LEFT_BUTTON)&&this._moveTouch(o.MOUSE_TOUCH_ID,this.getCursorX(),this.getCursorY())}_setCursorPosition(e,s){this._cursorX=e,this._cursorY=s}getCursorX(){return this._cursorX}getCursorY(){return this._cursorY}getMouseX(){return this._mouseX}getMouseY(){return this._mouseY}onMouseLeave(){this._isMouseInsideCanvas=!1}onMouseEnter(){this._isMouseInsideCanvas=!0}isMouseInsideCanvas(){return this._isMouseInsideCanvas}onMouseButtonPressed(e){this._setMouseButtonPressed(e),e===o.MOUSE_LEFT_BUTTON&&this._addTouch(o.MOUSE_TOUCH_ID,this.getCursorX(),this.getCursorY())}_setMouseButtonPressed(e){this._pressedMouseButtons[e]=!0,this._releasedMouseButtons[e]=!1}onMouseButtonReleased(e){this._setMouseButtonReleased(e),e===o.MOUSE_LEFT_BUTTON&&this._removeTouch(o.MOUSE_TOUCH_ID)}_setMouseButtonReleased(e){this._pressedMouseButtons[e]=!1,this._releasedMouseButtons[e]=!0}isMouseButtonPressed(e){return this._pressedMouseButtons[e]!==void 0&&this._pressedMouseButtons[e]}isMouseButtonReleased(e){return this._releasedMouseButtons[e]!==void 0&&this._releasedMouseButtons[e]}onMouseWheel(e){this._mouseWheelDelta=e}getMouseWheelDelta(){return this._mouseWheelDelta}getTouchX(e){return this._mouseOrTouches.containsKey(e)?this._mouseOrTouches.get(e).x:0}getTouchY(e){return this._mouseOrTouches.containsKey(e)?this._mouseOrTouches.get(e).y:0}hasTouchEnded(e){return this._mouseOrTouches.containsKey(e)?this._mouseOrTouches.get(e).justEnded:!1}getAllTouchIdentifiers(){o._allTouchIds.length=0;for(const e in this._mouseOrTouches.items)this._mouseOrTouches.items.hasOwnProperty(e)&&o._allTouchIds.push(parseInt(e,10));return o._allTouchIds}onTouchStart(e,s,t){this._addTouch(this.getPublicTouchIdentifier(e),s,t),this._touchSimulateMouse&&(this._setCursorPosition(s,t),this._setMouseButtonPressed(o.MOUSE_LEFT_BUTTON))}_addTouch(e,s,t){this._endedTouches.includes(e)||(this._startedTouches.push(e),this._mouseOrTouches.put(e,{x:s,y:t,justEnded:!1}))}onTouchMove(e,s,t){this._moveTouch(this.getPublicTouchIdentifier(e),s,t),this._touchSimulateMouse&&this._setCursorPosition(s,t)}_moveTouch(e,s,t){const u=this._mouseOrTouches.get(e);!u||(u.x=s,u.y=t)}onTouchEnd(e){this._removeTouch(this.getPublicTouchIdentifier(e)),this._touchSimulateMouse&&this._setMouseButtonReleased(o.MOUSE_LEFT_BUTTON)}onTouchCancel(e){this.onTouchEnd(e)}_removeTouch(e){this._endedTouches.push(e),this._mouseOrTouches.containsKey(e)&&(this._mouseOrTouches.get(e).justEnded=!0)}getPublicTouchIdentifier(e){return e+2}getStartedTouchIdentifiers(){return this._startedTouches}popStartedTouch(){const e=this._startedTouches[this._lastStartedTouchIndex];return this._lastStartedTouchIndex++,e}popEndedTouch(){const e=this._endedTouches[this._lastEndedTouchIndex];return this._lastEndedTouchIndex++,e}touchSimulateMouse(e){e===void 0&&(e=!0),this._touchSimulateMouse=e}isSimulatingMouseWithTouch(){return this._touchSimulateMouse}onFrameEnded(){for(const e in this._mouseOrTouches.items)this._mouseOrTouches.items.hasOwnProperty(e)&&this._mouseOrTouches.items[e].justEnded&&this._mouseOrTouches.remove(e);this._startedTouches.length=0,this._endedTouches.length=0,this._releasedKeys.clear(),this._releasedMouseButtons.length=0,this._mouseWheelDelta=0,this._lastStartedTouchIndex=0,this._lastEndedTouchIndex=0}isScrollingUp(){return this.getMouseWheelDelta()>0}isScrollingDown(){return this.getMouseWheelDelta()<0}clearAllPressedKeys(){this._pressedKeys.clear()}};let r=o;r.MOUSE_LEFT_BUTTON=0,r.MOUSE_RIGHT_BUTTON=1,r.MOUSE_MIDDLE_BUTTON=2,r.MOUSE_BACK_BUTTON=3,r.MOUSE_FORWARD_BUTTON=4,r.MOUSE_TOUCH_ID=1,r._DEFAULT_LEFT_VARIANT_KEYS=[16,17,18,91],r._allTouchIds=[],i.InputManager=r})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=inputmanager.js.map
jsonmanager.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(c){const l=new c.Logger("JSON Manager"),i=["json","tilemap","tileset"];class u{constructor(s){this._loadedJsons=new c.ResourceCache;this._callbacks=new c.ResourceCache;this._getJsonResource=s=>{const r=this._resourceLoader.getResource(s);return r&&this.getResourceKinds().includes(r.kind)?r:null};this._resourceLoader=s}getResourceKinds(){return i}async loadResource(s){const r=this._resourceLoader.getResource(s);if(!r){l.warn('Unable to find json for resource "'+s+'".');return}if(!r.disablePreload)try{await this.loadJsonAsync(r.name)}catch(e){l.error(`Error while preloading json resource ${r.name}:`,e)}}loadJsonAsync(s){const r=this;return new Promise((e,t)=>{r.loadJson(s,(o,n)=>{o&&t(o.message),e(n)})})}async processResource(s){}loadJson(s,r){const e=this._getJsonResource(s);if(!e){r(new Error(`Can't find resource with name: "`+s+'" (or is not a json resource).'),null);return}if(this._loadedJsons.get(e)){r(null,this._loadedJsons.get(e));return}{const n=this._callbacks.get(e);if(n){n.push(r);return}else this._callbacks.set(e,[r])}const t=this,o=new XMLHttpRequest;o.responseType="json",o.withCredentials=this._resourceLoader.checkIfCredentialsRequired(e.file),o.open("GET",this._resourceLoader.getFullUrl(e.file)),o.onload=function(){const n=t._callbacks.get(e);if(!!n){if(o.status!==200){for(const a of n)a(new Error("HTTP error: "+o.status+"("+o.statusText+")"),null);t._callbacks.delete(e);return}t._loadedJsons.set(e,o.response);for(const a of n)a(null,o.response);t._callbacks.delete(e)}},o.onerror=function(){const n=t._callbacks.get(e);if(!!n){for(const a of n)a(new Error("Network error"),null);t._callbacks.delete(e)}},o.onabort=function(){const n=t._callbacks.get(e);if(!!n){for(const a of n)a(new Error("Request aborted"),null);t._callbacks.delete(e)}},o.send()}isJsonLoaded(s){return!!this._loadedJsons.getFromName(s)}getLoadedJson(s){return this._loadedJsons.getFromName(s)||null}dispose(){this._loadedJsons.clear(),this._callbacks.clear()}}c.JsonManager=u})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=jsonmanager.js.map
layer.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(h){class c extends h.RuntimeLayer{constructor(t,e){super(t,e);this._cameraRotation=0;this._zoomFactor=1;this._cameraZ=0;this._isCameraZDirty=!0;this._defaultCameraBehavior===h.RuntimeLayerDefaultCameraBehavior.TOP_LEFT_ANCHORED_IF_NEVER_MOVED?(this._cameraX=this._runtimeScene.getViewportOriginX(),this._cameraY=this._runtimeScene.getViewportOriginY()):(this._cameraX=(this._runtimeScene.getInitialUnrotatedViewportMinX()+this._runtimeScene.getInitialUnrotatedViewportMaxX())/2,this._cameraY=(this._runtimeScene.getInitialUnrotatedViewportMinY()+this._runtimeScene.getInitialUnrotatedViewportMaxY())/2),this.getCameraType()===h.RuntimeLayerCameraType.ORTHOGRAPHIC&&(this._cameraZ=(this._initialCamera3DFarPlaneDistance+this._initialCamera3DNearPlaneDistance)/2),this._renderer.onCreated()}onGameResolutionResized(t,e){this._defaultCameraBehavior===h.RuntimeLayerDefaultCameraBehavior.TOP_LEFT_ANCHORED_IF_NEVER_MOVED&&Math.abs(this._cameraX-t)<1&&Math.abs(this._cameraY-e)<1&&this._zoomFactor===1&&(this._cameraX+=this._runtimeScene.getViewportOriginX()-t,this._cameraY+=this._runtimeScene.getViewportOriginY()-e),this._renderer.updatePosition(),this._renderer.updateResolution()}getCameraX(t){return this._forceDimensionUpdate(),this._cameraX}getCameraY(t){return this._forceDimensionUpdate(),this._cameraY}setCameraX(t,e){this._forceDimensionUpdate(),this._cameraX=t,this._renderer.updatePosition()}setCameraY(t,e){this._forceDimensionUpdate(),this._cameraY=t,this._renderer.updatePosition()}getCameraWidth(t){return this.getWidth()/this._zoomFactor}getCameraHeight(t){return this.getHeight()/this._zoomFactor}setCameraZoom(t,e){this._zoomFactor=t,this._isCameraZDirty=!0,this._renderer.updatePosition()}getCameraZoom(t){return this._zoomFactor}setCameraZ(t,e,i){if(e){const r=h.toRad(e),a=Math.min(Number.MAX_SAFE_INTEGER,.5*this.getHeight()/(t*Math.tan(.5*r)));a>0&&(this._zoomFactor=a)}this._cameraZ=t,this._isCameraZDirty=!1,this._renderer.updatePosition()}getCameraZ(t,e){return!this._isCameraZDirty||!t?this._cameraZ:.5*this.getHeight()/this.getCameraZoom()/Math.tan(.5*h.toRad(t))}getCameraRotation(t){return this._cameraRotation}setCameraRotation(t,e){this._cameraRotation=t,this._renderer.updatePosition()}convertCoords(t,e,i=0,r){let a=r||[0,0];if(this._renderer.isCameraRotatedIn3D())return this._renderer.transformTo3DWorld(t,e,0,i,r);t-=this.getRuntimeScene()._cachedGameResolutionWidth/2,e-=this.getRuntimeScene()._cachedGameResolutionHeight/2,t/=Math.abs(this._zoomFactor),e/=Math.abs(this._zoomFactor);const n=this._cameraRotation/180*Math.PI,s=t,o=Math.cos(n),m=Math.sin(n);return t=o*t-m*e,e=m*s+o*e,a[0]=t+this.getCameraX(i),a[1]=e+this.getCameraY(i),a}applyLayerInverseTransformation(t,e,i,r){t-=this._runtimeScene.getViewportOriginX(),e-=this._runtimeScene.getViewportOriginY(),t/=Math.abs(this._zoomFactor),e/=Math.abs(this._zoomFactor);const a=this._cameraRotation/180*Math.PI,n=t,s=Math.cos(a),o=Math.sin(a);return t=s*t-o*e,e=o*n+s*e,r[0]=t+this.getCameraX(i),r[1]=e+this.getCameraY(i),r}convertInverseCoords(t,e,i=0,r){let a=r||[0,0];t-=this.getCameraX(i),e-=this.getCameraY(i);const n=this._cameraRotation/180*Math.PI,s=t,o=Math.cos(-n),m=Math.sin(-n);return t=o*t-m*e,e=m*s+o*e,t*=Math.abs(this._zoomFactor),e*=Math.abs(this._zoomFactor),a[0]=t+this.getRuntimeScene()._cachedGameResolutionWidth/2,a[1]=e+this.getRuntimeScene()._cachedGameResolutionHeight/2,a}applyLayerTransformation(t,e,i,r){t-=this.getCameraX(i),e-=this.getCameraY(i);const a=this._cameraRotation/180*Math.PI,n=t,s=Math.cos(-a),o=Math.sin(-a);return t=s*t-o*e,e=o*n+s*e,t*=Math.abs(this._zoomFactor),e*=Math.abs(this._zoomFactor),t+=this._runtimeScene.getViewportOriginX(),e+=this._runtimeScene.getViewportOriginY(),r[0]=t,r[1]=e,r}_forceDimensionUpdate(){this._runtimeScene.getViewportWidth()}}h.Layer=c})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=layer.js.map
libs/jshashtable.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ class Hashtable{constructor(){this.items={}}static newFrom(t){const s=new Hashtable;return s.items=t,s}put(t,s){this.items[t]=s}get(t){return this.items[t]}containsKey(t){return this.items.hasOwnProperty(t)}remove(t){delete this.items[t]}firstKey(){for(const t in this.items)if(this.items.hasOwnProperty(t))return t;return null}keys(t){t.length=0;for(const s in this.items)this.items.hasOwnProperty(s)&&t.push(s)}values(t){t.length=0;for(const s in this.items)this.items.hasOwnProperty(s)&&t.push(this.items[s])}clear(){for(const t in this.items)this.items.hasOwnProperty(t)&&delete this.items[t]}}
2
+ //# sourceMappingURL=jshashtable.js.map
libs/rbush.js ADDED
@@ -0,0 +1,624 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.rbush = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
+ 'use strict';
3
+
4
+ module.exports = rbush;
5
+
6
+ var quickselect = require('quickselect');
7
+
8
+ function rbush(maxEntries, format) {
9
+ if (!(this instanceof rbush)) return new rbush(maxEntries, format);
10
+
11
+ // max entries in a node is 9 by default; min node fill is 40% for best performance
12
+ this._maxEntries = Math.max(4, maxEntries || 9);
13
+ this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
14
+
15
+ if (format) {
16
+ this._initFormat(format);
17
+ }
18
+
19
+ this.clear();
20
+ }
21
+
22
+ rbush.prototype = {
23
+
24
+ all: function () {
25
+ return this._all(this.data, []);
26
+ },
27
+
28
+ search: function (bbox) {
29
+
30
+ var node = this.data,
31
+ result = [],
32
+ toBBox = this.toBBox;
33
+
34
+ if (!intersects(bbox, node)) return result;
35
+
36
+ var nodesToSearch = [],
37
+ i, len, child, childBBox;
38
+
39
+ while (node) {
40
+ for (i = 0, len = node.children.length; i < len; i++) {
41
+
42
+ child = node.children[i];
43
+ childBBox = node.leaf ? toBBox(child) : child;
44
+
45
+ if (intersects(bbox, childBBox)) {
46
+ if (node.leaf) result.push(child);
47
+ else if (contains(bbox, childBBox)) this._all(child, result);
48
+ else nodesToSearch.push(child);
49
+ }
50
+ }
51
+ node = nodesToSearch.pop();
52
+ }
53
+
54
+ return result;
55
+ },
56
+
57
+ collides: function (bbox) {
58
+
59
+ var node = this.data,
60
+ toBBox = this.toBBox;
61
+
62
+ if (!intersects(bbox, node)) return false;
63
+
64
+ var nodesToSearch = [],
65
+ i, len, child, childBBox;
66
+
67
+ while (node) {
68
+ for (i = 0, len = node.children.length; i < len; i++) {
69
+
70
+ child = node.children[i];
71
+ childBBox = node.leaf ? toBBox(child) : child;
72
+
73
+ if (intersects(bbox, childBBox)) {
74
+ if (node.leaf || contains(bbox, childBBox)) return true;
75
+ nodesToSearch.push(child);
76
+ }
77
+ }
78
+ node = nodesToSearch.pop();
79
+ }
80
+
81
+ return false;
82
+ },
83
+
84
+ load: function (data) {
85
+ if (!(data && data.length)) return this;
86
+
87
+ if (data.length < this._minEntries) {
88
+ for (var i = 0, len = data.length; i < len; i++) {
89
+ this.insert(data[i]);
90
+ }
91
+ return this;
92
+ }
93
+
94
+ // recursively build the tree with the given data from scratch using OMT algorithm
95
+ var node = this._build(data.slice(), 0, data.length - 1, 0);
96
+
97
+ if (!this.data.children.length) {
98
+ // save as is if tree is empty
99
+ this.data = node;
100
+
101
+ } else if (this.data.height === node.height) {
102
+ // split root if trees have the same height
103
+ this._splitRoot(this.data, node);
104
+
105
+ } else {
106
+ if (this.data.height < node.height) {
107
+ // swap trees if inserted one is bigger
108
+ var tmpNode = this.data;
109
+ this.data = node;
110
+ node = tmpNode;
111
+ }
112
+
113
+ // insert the small tree into the large tree at appropriate level
114
+ this._insert(node, this.data.height - node.height - 1, true);
115
+ }
116
+
117
+ return this;
118
+ },
119
+
120
+ insert: function (item) {
121
+ if (item) this._insert(item, this.data.height - 1);
122
+ return this;
123
+ },
124
+
125
+ clear: function () {
126
+ this.data = createNode([]);
127
+ return this;
128
+ },
129
+
130
+ remove: function (item, equalsFn) {
131
+ if (!item) return this;
132
+
133
+ var node = this.data,
134
+ bbox = this.toBBox(item),
135
+ path = [],
136
+ indexes = [],
137
+ i, parent, index, goingUp;
138
+
139
+ // depth-first iterative tree traversal
140
+ while (node || path.length) {
141
+
142
+ if (!node) { // go up
143
+ node = path.pop();
144
+ parent = path[path.length - 1];
145
+ i = indexes.pop();
146
+ goingUp = true;
147
+ }
148
+
149
+ if (node.leaf) { // check current node
150
+ index = findItem(item, node.children, equalsFn);
151
+
152
+ if (index !== -1) {
153
+ // item found, remove the item and condense tree upwards
154
+ node.children.splice(index, 1);
155
+ path.push(node);
156
+ this._condense(path);
157
+ return this;
158
+ }
159
+ }
160
+
161
+ if (!goingUp && !node.leaf && contains(node, bbox)) { // go down
162
+ path.push(node);
163
+ indexes.push(i);
164
+ i = 0;
165
+ parent = node;
166
+ node = node.children[0];
167
+
168
+ } else if (parent) { // go right
169
+ i++;
170
+ node = parent.children[i];
171
+ goingUp = false;
172
+
173
+ } else node = null; // nothing found
174
+ }
175
+
176
+ return this;
177
+ },
178
+
179
+ toBBox: function (item) { return item; },
180
+
181
+ compareMinX: compareNodeMinX,
182
+ compareMinY: compareNodeMinY,
183
+
184
+ toJSON: function () { return this.data; },
185
+
186
+ fromJSON: function (data) {
187
+ this.data = data;
188
+ return this;
189
+ },
190
+
191
+ _all: function (node, result) {
192
+ var nodesToSearch = [];
193
+ while (node) {
194
+ if (node.leaf) result.push.apply(result, node.children);
195
+ else nodesToSearch.push.apply(nodesToSearch, node.children);
196
+
197
+ node = nodesToSearch.pop();
198
+ }
199
+ return result;
200
+ },
201
+
202
+ _build: function (items, left, right, height) {
203
+
204
+ var N = right - left + 1,
205
+ M = this._maxEntries,
206
+ node;
207
+
208
+ if (N <= M) {
209
+ // reached leaf level; return leaf
210
+ node = createNode(items.slice(left, right + 1));
211
+ calcBBox(node, this.toBBox);
212
+ return node;
213
+ }
214
+
215
+ if (!height) {
216
+ // target height of the bulk-loaded tree
217
+ height = Math.ceil(Math.log(N) / Math.log(M));
218
+
219
+ // target number of root entries to maximize storage utilization
220
+ M = Math.ceil(N / Math.pow(M, height - 1));
221
+ }
222
+
223
+ node = createNode([]);
224
+ node.leaf = false;
225
+ node.height = height;
226
+
227
+ // split the items into M mostly square tiles
228
+
229
+ var N2 = Math.ceil(N / M),
230
+ N1 = N2 * Math.ceil(Math.sqrt(M)),
231
+ i, j, right2, right3;
232
+
233
+ multiSelect(items, left, right, N1, this.compareMinX);
234
+
235
+ for (i = left; i <= right; i += N1) {
236
+
237
+ right2 = Math.min(i + N1 - 1, right);
238
+
239
+ multiSelect(items, i, right2, N2, this.compareMinY);
240
+
241
+ for (j = i; j <= right2; j += N2) {
242
+
243
+ right3 = Math.min(j + N2 - 1, right2);
244
+
245
+ // pack each entry recursively
246
+ node.children.push(this._build(items, j, right3, height - 1));
247
+ }
248
+ }
249
+
250
+ calcBBox(node, this.toBBox);
251
+
252
+ return node;
253
+ },
254
+
255
+ _chooseSubtree: function (bbox, node, level, path) {
256
+
257
+ var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;
258
+
259
+ while (true) {
260
+ path.push(node);
261
+
262
+ if (node.leaf || path.length - 1 === level) break;
263
+
264
+ minArea = minEnlargement = Infinity;
265
+
266
+ for (i = 0, len = node.children.length; i < len; i++) {
267
+ child = node.children[i];
268
+ area = bboxArea(child);
269
+ enlargement = enlargedArea(bbox, child) - area;
270
+
271
+ // choose entry with the least area enlargement
272
+ if (enlargement < minEnlargement) {
273
+ minEnlargement = enlargement;
274
+ minArea = area < minArea ? area : minArea;
275
+ targetNode = child;
276
+
277
+ } else if (enlargement === minEnlargement) {
278
+ // otherwise choose one with the smallest area
279
+ if (area < minArea) {
280
+ minArea = area;
281
+ targetNode = child;
282
+ }
283
+ }
284
+ }
285
+
286
+ node = targetNode || node.children[0];
287
+ }
288
+
289
+ return node;
290
+ },
291
+
292
+ _insert: function (item, level, isNode) {
293
+
294
+ var toBBox = this.toBBox,
295
+ bbox = isNode ? item : toBBox(item),
296
+ insertPath = [];
297
+
298
+ // find the best node for accommodating the item, saving all nodes along the path too
299
+ var node = this._chooseSubtree(bbox, this.data, level, insertPath);
300
+
301
+ // put the item into the node
302
+ node.children.push(item);
303
+ extend(node, bbox);
304
+
305
+ // split on node overflow; propagate upwards if necessary
306
+ while (level >= 0) {
307
+ if (insertPath[level].children.length > this._maxEntries) {
308
+ this._split(insertPath, level);
309
+ level--;
310
+ } else break;
311
+ }
312
+
313
+ // adjust bboxes along the insertion path
314
+ this._adjustParentBBoxes(bbox, insertPath, level);
315
+ },
316
+
317
+ // split overflowed node into two
318
+ _split: function (insertPath, level) {
319
+
320
+ var node = insertPath[level],
321
+ M = node.children.length,
322
+ m = this._minEntries;
323
+
324
+ this._chooseSplitAxis(node, m, M);
325
+
326
+ var splitIndex = this._chooseSplitIndex(node, m, M);
327
+
328
+ var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));
329
+ newNode.height = node.height;
330
+ newNode.leaf = node.leaf;
331
+
332
+ calcBBox(node, this.toBBox);
333
+ calcBBox(newNode, this.toBBox);
334
+
335
+ if (level) insertPath[level - 1].children.push(newNode);
336
+ else this._splitRoot(node, newNode);
337
+ },
338
+
339
+ _splitRoot: function (node, newNode) {
340
+ // split root node
341
+ this.data = createNode([node, newNode]);
342
+ this.data.height = node.height + 1;
343
+ this.data.leaf = false;
344
+ calcBBox(this.data, this.toBBox);
345
+ },
346
+
347
+ _chooseSplitIndex: function (node, m, M) {
348
+
349
+ var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;
350
+
351
+ minOverlap = minArea = Infinity;
352
+
353
+ for (i = m; i <= M - m; i++) {
354
+ bbox1 = distBBox(node, 0, i, this.toBBox);
355
+ bbox2 = distBBox(node, i, M, this.toBBox);
356
+
357
+ overlap = intersectionArea(bbox1, bbox2);
358
+ area = bboxArea(bbox1) + bboxArea(bbox2);
359
+
360
+ // choose distribution with minimum overlap
361
+ if (overlap < minOverlap) {
362
+ minOverlap = overlap;
363
+ index = i;
364
+
365
+ minArea = area < minArea ? area : minArea;
366
+
367
+ } else if (overlap === minOverlap) {
368
+ // otherwise choose distribution with minimum area
369
+ if (area < minArea) {
370
+ minArea = area;
371
+ index = i;
372
+ }
373
+ }
374
+ }
375
+
376
+ return index;
377
+ },
378
+
379
+ // sorts node children by the best axis for split
380
+ _chooseSplitAxis: function (node, m, M) {
381
+
382
+ var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,
383
+ compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,
384
+ xMargin = this._allDistMargin(node, m, M, compareMinX),
385
+ yMargin = this._allDistMargin(node, m, M, compareMinY);
386
+
387
+ // if total distributions margin value is minimal for x, sort by minX,
388
+ // otherwise it's already sorted by minY
389
+ if (xMargin < yMargin) node.children.sort(compareMinX);
390
+ },
391
+
392
+ // total margin of all possible split distributions where each node is at least m full
393
+ _allDistMargin: function (node, m, M, compare) {
394
+
395
+ node.children.sort(compare);
396
+
397
+ var toBBox = this.toBBox,
398
+ leftBBox = distBBox(node, 0, m, toBBox),
399
+ rightBBox = distBBox(node, M - m, M, toBBox),
400
+ margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),
401
+ i, child;
402
+
403
+ for (i = m; i < M - m; i++) {
404
+ child = node.children[i];
405
+ extend(leftBBox, node.leaf ? toBBox(child) : child);
406
+ margin += bboxMargin(leftBBox);
407
+ }
408
+
409
+ for (i = M - m - 1; i >= m; i--) {
410
+ child = node.children[i];
411
+ extend(rightBBox, node.leaf ? toBBox(child) : child);
412
+ margin += bboxMargin(rightBBox);
413
+ }
414
+
415
+ return margin;
416
+ },
417
+
418
+ _adjustParentBBoxes: function (bbox, path, level) {
419
+ // adjust bboxes along the given tree path
420
+ for (var i = level; i >= 0; i--) {
421
+ extend(path[i], bbox);
422
+ }
423
+ },
424
+
425
+ _condense: function (path) {
426
+ // go through the path, removing empty nodes and updating bboxes
427
+ for (var i = path.length - 1, siblings; i >= 0; i--) {
428
+ if (path[i].children.length === 0) {
429
+ if (i > 0) {
430
+ siblings = path[i - 1].children;
431
+ siblings.splice(siblings.indexOf(path[i]), 1);
432
+
433
+ } else this.clear();
434
+
435
+ } else calcBBox(path[i], this.toBBox);
436
+ }
437
+ },
438
+
439
+ _initFormat: function (format) {
440
+ // data format (minX, minY, maxX, maxY accessors)
441
+
442
+ // uses eval-type function compilation instead of just accepting a toBBox function
443
+ // because the algorithms are very sensitive to sorting functions performance,
444
+ // so they should be dead simple and without inner calls
445
+
446
+ var compareArr = ['return a', ' - b', ';'];
447
+
448
+ this.compareMinX = new Function('a', 'b', compareArr.join(format[0]));
449
+ this.compareMinY = new Function('a', 'b', compareArr.join(format[1]));
450
+
451
+ this.toBBox = new Function('a',
452
+ 'return {minX: a' + format[0] +
453
+ ', minY: a' + format[1] +
454
+ ', maxX: a' + format[2] +
455
+ ', maxY: a' + format[3] + '};');
456
+ }
457
+ };
458
+
459
+ function findItem(item, items, equalsFn) {
460
+ if (!equalsFn) return items.indexOf(item);
461
+
462
+ for (var i = 0; i < items.length; i++) {
463
+ if (equalsFn(item, items[i])) return i;
464
+ }
465
+ return -1;
466
+ }
467
+
468
+ // calculate node's bbox from bboxes of its children
469
+ function calcBBox(node, toBBox) {
470
+ distBBox(node, 0, node.children.length, toBBox, node);
471
+ }
472
+
473
+ // min bounding rectangle of node children from k to p-1
474
+ function distBBox(node, k, p, toBBox, destNode) {
475
+ if (!destNode) destNode = createNode(null);
476
+ destNode.minX = Infinity;
477
+ destNode.minY = Infinity;
478
+ destNode.maxX = -Infinity;
479
+ destNode.maxY = -Infinity;
480
+
481
+ for (var i = k, child; i < p; i++) {
482
+ child = node.children[i];
483
+ extend(destNode, node.leaf ? toBBox(child) : child);
484
+ }
485
+
486
+ return destNode;
487
+ }
488
+
489
+ function extend(a, b) {
490
+ a.minX = Math.min(a.minX, b.minX);
491
+ a.minY = Math.min(a.minY, b.minY);
492
+ a.maxX = Math.max(a.maxX, b.maxX);
493
+ a.maxY = Math.max(a.maxY, b.maxY);
494
+ return a;
495
+ }
496
+
497
+ function compareNodeMinX(a, b) { return a.minX - b.minX; }
498
+ function compareNodeMinY(a, b) { return a.minY - b.minY; }
499
+
500
+ function bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }
501
+ function bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }
502
+
503
+ function enlargedArea(a, b) {
504
+ return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *
505
+ (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));
506
+ }
507
+
508
+ function intersectionArea(a, b) {
509
+ var minX = Math.max(a.minX, b.minX),
510
+ minY = Math.max(a.minY, b.minY),
511
+ maxX = Math.min(a.maxX, b.maxX),
512
+ maxY = Math.min(a.maxY, b.maxY);
513
+
514
+ return Math.max(0, maxX - minX) *
515
+ Math.max(0, maxY - minY);
516
+ }
517
+
518
+ function contains(a, b) {
519
+ return a.minX <= b.minX &&
520
+ a.minY <= b.minY &&
521
+ b.maxX <= a.maxX &&
522
+ b.maxY <= a.maxY;
523
+ }
524
+
525
+ function intersects(a, b) {
526
+ return b.minX <= a.maxX &&
527
+ b.minY <= a.maxY &&
528
+ b.maxX >= a.minX &&
529
+ b.maxY >= a.minY;
530
+ }
531
+
532
+ function createNode(children) {
533
+ return {
534
+ children: children,
535
+ height: 1,
536
+ leaf: true,
537
+ minX: Infinity,
538
+ minY: Infinity,
539
+ maxX: -Infinity,
540
+ maxY: -Infinity
541
+ };
542
+ }
543
+
544
+ // sort an array so that items come in groups of n unsorted items, with groups sorted between each other;
545
+ // combines selection algorithm with binary divide & conquer approach
546
+
547
+ function multiSelect(arr, left, right, n, compare) {
548
+ var stack = [left, right],
549
+ mid;
550
+
551
+ while (stack.length) {
552
+ right = stack.pop();
553
+ left = stack.pop();
554
+
555
+ if (right - left <= n) continue;
556
+
557
+ mid = left + Math.ceil((right - left) / n / 2) * n;
558
+ quickselect(arr, mid, left, right, compare);
559
+
560
+ stack.push(left, mid, mid, right);
561
+ }
562
+ }
563
+
564
+ },{"quickselect":2}],2:[function(require,module,exports){
565
+ 'use strict';
566
+
567
+ module.exports = partialSort;
568
+
569
+ // Floyd-Rivest selection algorithm:
570
+ // Rearrange items so that all items in the [left, k] range are smaller than all items in (k, right];
571
+ // The k-th element will have the (k - left + 1)th smallest value in [left, right]
572
+
573
+ function partialSort(arr, k, left, right, compare) {
574
+
575
+ while (right > left) {
576
+ if (right - left > 600) {
577
+ var n = right - left + 1;
578
+ var m = k - left + 1;
579
+ var z = Math.log(n);
580
+ var s = 0.5 * Math.exp(2 * z / 3);
581
+ var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
582
+ var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
583
+ var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
584
+ partialSort(arr, k, newLeft, newRight, compare);
585
+ }
586
+
587
+ var t = arr[k];
588
+ var i = left;
589
+ var j = right;
590
+
591
+ swap(arr, left, k);
592
+ if (compare(arr[right], t) > 0) swap(arr, left, right);
593
+
594
+ while (i < j) {
595
+ swap(arr, i, j);
596
+ i++;
597
+ j--;
598
+ while (compare(arr[i], t) < 0) i++;
599
+ while (compare(arr[j], t) > 0) j--;
600
+ }
601
+
602
+ if (compare(arr[left], t) === 0) swap(arr, left, j);
603
+ else {
604
+ j++;
605
+ swap(arr, j, right);
606
+ }
607
+
608
+ if (j <= k) left = j + 1;
609
+ if (k <= j) right = j - 1;
610
+ }
611
+ }
612
+
613
+ function swap(arr, i, j) {
614
+ var tmp = arr[i];
615
+ arr[i] = arr[j];
616
+ arr[j] = tmp;
617
+ }
618
+
619
+ function defaultCompare(a, b) {
620
+ return a < b ? -1 : a > b ? 1 : 0;
621
+ }
622
+
623
+ },{}]},{},[1])(1)
624
+ });
logger.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ var gdjs;(function(l){const g={info:console.log,warning:console.warn,error:console.error};class i{constructor(){this.discardedConsoleGroups=new Set}discardGroup(o){this.discardedConsoleGroups.add(o)}enableGroup(o){this.discardedConsoleGroups.delete(o)}log(o,n,u="info",p=!0){if(this.discardedConsoleGroups.has(o))return;(g[u]||g.info)(`[${o}] ${n}`)}}const s=new i;let r=s;function t(e){return e.reduce((o,n)=>o+n.toString(),"")}class a{constructor(o){this.group=o}log(...o){r.log(this.group,t(o),"info")}info(...o){r.log(this.group,t(o),"info")}warn(...o){r.log(this.group,t(o),"warning")}error(...o){r.log(this.group,t(o),"error")}static getDefaultConsoleLoggerOutput(){return s}static getLoggerOutput(){return r}static setLoggerOutput(o){r=o}}l.Logger=a})(gdjs||(gdjs={}));
2
+ //# sourceMappingURL=logger.js.map