This commit is contained in:
mileswa1q2 authored and GitHub committed 2023-11-23 20:37:33 +00:00
1 parent 1cf1d1988e
commit 40fdf2a04e
714 files changed
+3 -3

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
var gdjs;(function(n){const _=(A,e,t,i)=>{const s=Math.max(t,A-t),r=Math.max(i,e-i);return Math.pow(s,2)+Math.pow(r,2)},x={moveXArray:[],moveYArray:[]},F={result:n.Polygon.makeNewRaycastTestResult()},D=(A,e,t)=>{if(e.length===0)return e.length=0,t.length=0,!1;if(e.length===1)return A.setPosition(A.getX()+e[0],A.getY()+t[0]),e.length=0,t.length=0,!0;let i=0,s=0;for(let b=0;b<e.length;b++){const C=e[b],f=t[b],y=C*C+f*f;y>i&&(i=y,s=b)}const r=Math.sqrt(i),a=e[s]/r,h=-(t[s]/r),c=a;let d=0,g=0;for(let b=0;b<e.length;b++){const C=e[b],f=t[b],y=C*h+f*c;d=Math.min(d,y),g=Math.max(g,y)}let u=e[s],B=t[s];const v=-d<g/1048576,p=g<-d/1048576;return v!==p&&(p?(u+=d*h,B+=d*c):(u+=g*h,B+=g*c)),A.setPosition(A.getX()+u,A.getY()+B),e.length=0,t.length=0,!0},o=class{constructor(e,t){this.x=0;this.y=0;this.angle=0;this.zOrder=0;this.hidden=!1;this.layer="";this._livingOnScene=!0;this.destroyCallbacks=new Set;this.persistentUuid=null;this.pick=!1;this._defaultHitBoxes=[];this.hitBoxesDirty=!0;this.aabb={min:[0,0],max:[0,0]};this._isIncludedInParentCollisionMask=!0;this._rendererEffects={};this._instantForces=[];this._permanentForceX=0;this._permanentForceY=0;this._behaviors=[];this.getVariableNumber=o.getVariableNumber;this.returnVariable=o.returnVariable;this.getVariableString=o.getVariableString;this.setVariableNumber=o.setVariableNumber;this.setVariableString=o.setVariableString;this.getVariableBoolean=o.getVariableBoolean;this.setVariableBoolean=o.setVariableBoolean;this.getVariableChildCount=o.getVariableChildCount;this.getFirstVariableNumber=o.getFirstVariableNumber;this.getFirstVariableString=o.getFirstVariableString;this.getLastVariableNumber=o.getLastVariableNumber;this.getLastVariableString=o.getLastVariableString;this.toggleVariableBoolean=o.toggleVariableBoolean;this.variableChildExists=o.variableChildExists;this.variableRemoveChild=o.variableRemoveChild;this.variableClearChildren=o.variableClearChildren;this.variablePushCopy=o.variablePushCopy;this.valuePush=o.valuePush;this.variableRemoveAt=o.variableRemoveAt;this.getSqDistanceTo=o.prototype.getSqDistanceToPosition;this.name=t.name||"",this.type=t.type||"",this._nameId=o.getNameIdentifier(this.name),this.id=e.getScene().createNewUniqueId(),this._runtimeScene=e,this._defaultHitBoxes.push(n.Polygon.createRectangle(0,0)),this.hitBoxes=this._defaultHitBoxes,this._variables=new n.VariablesContainer(t?t.variables:void 0),this._totalForce=new n.Force(0,0,0),this._behaviorsTable=new Hashtable;for(let i=0;i<t.effects.length;++i)this._runtimeScene.getGame().getEffectsManager().initializeEffect(t.effects[i],this._rendererEffects,this),this.updateAllEffectParameters(t.effects[i]);for(let i=0,s=t.behaviors.length;i<s;++i){const r=t.behaviors[i],a=n.getBehaviorConstructor(r.type),l=new a(e,r,this);l.usesLifecycleFunction()&&this._behaviors.push(l),this._behaviorsTable.put(r.name,l)}this._timers=new Hashtable}onCreated(){if(this.getRendererObject())for(const t in this._rendererEffects)this._rendererEffects[t].applyEffect(this);for(let t=0;t<this._behaviors.length;++t)this._behaviors[t].onCreated()}reinitialize(e){const t=this._runtimeScene;this.x=0,this.y=0,this.angle=0,this.zOrder=0,this.hidden=!1,this.layer="",this._livingOnScene=!0,this.id=t.createNewUniqueId(),this.persistentUuid=null,this.pick=!1,this.hitBoxesDirty=!0,this._defaultHitBoxes.length=0,this._defaultHitBoxes.push(n.Polygon.createRectangle(0,0)),this.aabb.min[0]=0,this.aabb.min[1]=0,this.aabb.max[0]=0,this.aabb.max[1]=0,this._variables=new n.VariablesContainer(e.variables),this.clearForces(),this._behaviorsTable.clear();const i=e.behaviors.length;let s=0;for(let r=0;r<i;++r){const a=e.behaviors[r],l=n.getBehaviorConstructor(a.type),h=new l(t,a,this);h.usesLifecycleFunction()&&(s<this._behaviors.length?this._behaviors[s]=h:this._behaviors.push(h),s++),this._behaviorsTable.put(a.name,h)}this._behaviors.length=s;for(let r=0;r<e.effects.length;++r)this._runtimeScene.getGame().getEffectsManager().initializeEffect(e.effects[r],this._rendererEffects,this),this.updateAllEffectParameters(e.effects[r]);this._timers.clear(),this.destroyCallbacks.clear(),this.invalidateHitboxes()}getElapsedTime(e){return this._runtimeScene.getLayer(this.layer).getElapsedTime()}getParent(){return this._runtimeScene}getRuntimeScene(){return this._runtimeScene.getScene()}getInstanceContainer(){return this._runtimeScene}update(e){}updatePreRender(e){}extraInitializationFromInitialInstance(e){}updateFromObjectData(e,t){return!1}deleteFromScene(e){this._livingOnScene&&(e.markObjectForDeletion(this),this._livingOnScene=!1)}registerDestroyCallback(e){this.destroyCallbacks.add(e)}unregisterDestroyCallback(e){this.destroyCallbacks.delete(e)}onDeletedFromScene(e){const t=e.getLayer(this.layer),i=this.getRendererObject();i&&t.getRenderer().removeRendererObject(i);const s=this.get3DRendererObject();s&&t.getRenderer().remove3DRendererObject(s);for(let r=0,a=this._behaviors.length;r<a;++r)this._behaviors[r].onDestroy();this.destroyCallbacks.forEach(r=>r(Line truncated
//# sourceMappingURL=runtimeobject.js.map