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

@@ -0,0 +1,2 @@
var gdjs;(function(n){const m=class extends n.RuntimeBehavior{constructor(e,t,i){super(e,t,i);this._ignoreTouchingEdges=!0;this._slopeClimbingFactor=1;this._useLegacyTrajectory=!0;this._canGoDownFromJumpthru=!1;this._currentSpeed=0;this._requestedDeltaX=0;this._requestedDeltaY=0;this._lastDeltaY=0;this._currentFallSpeed=0;this._canJump=!1;this._lastDirectionIsLeft=!1;this._leftKey=!1;this._rightKey=!1;this._ladderKey=!1;this._upKey=!1;this._downKey=!1;this._jumpKey=!1;this._releasePlatformKey=!1;this._releaseLadderKey=!1;this._wasLeftKeyPressed=!1;this._wasRightKeyPressed=!1;this._wasLadderKeyPressed=!1;this._wasUpKeyPressed=!1;this._wasDownKeyPressed=!1;this._wasJumpKeyPressed=!1;this._wasReleasePlatformKeyPressed=!1;this._wasReleaseLadderKeyPressed=!1;this._hasReallyMoved=!1;this._hasMovedAtLeastOnePixel=!1;this._gravity=t.gravity,this._maxFallingSpeed=t.maxFallingSpeed,this._ladderClimbingSpeed=t.ladderClimbingSpeed||150,this._acceleration=t.acceleration,this._deceleration=t.deceleration,this._maxSpeed=t.maxSpeed,this._jumpSpeed=t.jumpSpeed,this._canGrabPlatforms=t.canGrabPlatforms||!1,this._canGrabWithoutMoving=t.canGrabWithoutMoving,this._yGrabOffset=t.yGrabOffset||0,this._xGrabTolerance=t.xGrabTolerance||10,this._jumpSustainTime=t.jumpSustainTime||0,this._ignoreDefaultControls=t.ignoreDefaultControls,this._useLegacyTrajectory=t.useLegacyTrajectory===void 0?!0:t.useLegacyTrajectory,this._canGoDownFromJumpthru=t.canGoDownFromJumpthru,this._slopeMaxAngle=0,this.setSlopeMaxAngle(t.slopeMaxAngle),this._potentialCollidingObjects=[],this._overlappedJumpThru=[],this._manager=n.PlatformObjectsManager.getManager(e),this._falling=new S(this),this._onFloor=new y(this),this._jumping=new M(this),this._grabbingPlatform=new Y(this),this._onLadder=new j(this),this._state=this._falling}updateFromBehaviorData(e,t){return e.gravity!==t.gravity&&this.setGravity(t.gravity),e.maxFallingSpeed!==t.maxFallingSpeed&&this.setMaxFallingSpeed(t.maxFallingSpeed),e.acceleration!==t.acceleration&&this.setAcceleration(t.acceleration),e.deceleration!==t.deceleration&&this.setDeceleration(t.deceleration),e.maxSpeed!==t.maxSpeed&&this.setMaxSpeed(t.maxSpeed),e.jumpSpeed!==t.jumpSpeed&&this.setJumpSpeed(t.jumpSpeed),e.canGrabPlatforms!==t.canGrabPlatforms&&this.setCanGrabPlatforms(t.canGrabPlatforms),e.canGrabWithoutMoving!==t.canGrabWithoutMoving&&(this._canGrabWithoutMoving=t.canGrabWithoutMoving),e.yGrabOffset!==t.yGrabOffset&&(this._yGrabOffset=t.yGrabOffset),e.xGrabTolerance!==t.xGrabTolerance&&(this._xGrabTolerance=t.xGrabTolerance),e.jumpSustainTime!==t.jumpSustainTime&&this.setJumpSustainTime(t.jumpSustainTime),e.useLegacyTrajectory!==t.useLegacyTrajectory&&(this._useLegacyTrajectory=t.useLegacyTrajectory),e.canGoDownFromJumpthru!==t.canGoDownFromJumpthru&&(this._canGoDownFromJumpthru=t.canGoDownFromJumpthru),!0}doStepPreEvents(e){const t=37,i=38,s=39,r=40,l=1016,o=2016,f=32,a=this.owner,h=this.owner.getElapsedTime()/1e3;this._requestedDeltaX=0,this._requestedDeltaY=0;const _=e.getGame().getInputManager();this._leftKey||(this._leftKey=!this._ignoreDefaultControls&&_.isKeyPressed(t)),this._rightKey||(this._rightKey=!this._ignoreDefaultControls&&_.isKeyPressed(s)),this._jumpKey||(this._jumpKey=!this._ignoreDefaultControls&&(_.isKeyPressed(l)||_.isKeyPressed(o)||_.isKeyPressed(f))),this._ladderKey||(this._ladderKey=!this._ignoreDefaultControls&&_.isKeyPressed(i)),this._upKey||(this._upKey=!this._ignoreDefaultControls&&_.isKeyPressed(i)),this._downKey||(this._downKey=!this._ignoreDefaultControls&&_.isKeyPressed(r)),this._releasePlatformKey||(this._releasePlatformKey=!this._ignoreDefaultControls&&_.isKeyPressed(r)),this._requestedDeltaX+=this._updateSpeed(h),this._leftKey!==this._rightKey&&(this._lastDirectionIsLeft=this._leftKey),this._state.beforeUpdatingObstacles(h),this._onFloor._oldHeight=a.getHeight(),this._updatePotentialCollidingObjects(Math.max(this._requestedDeltaX,this._maxFallingSpeed*h)),this._updateOverlappedJumpThru();const d=this._state;this._state.checkTransitionBeforeX(),this._state.beforeMovingX(),this._separateFromPlatforms(this._potentialCollidingObjects,!0)&&(this._canJump=!0);const u=a.getX();this._moveX();const p=a.getX()!==u+this._requestedDeltaX,F=this._state;this._state.checkTransitionBeforeY(h),this._state.beforeMovingY(h,u);const P=a.getY();this._moveY();const O=this._state;this._state!==this._onLadder&&this._checkTransitionOnFloorOrFalling(),p&&this._state===d&&this._state===F&&this._state===O&&this._state!==this._onFloor&&(this._currentSpeed=0),this._wasLeftKeyPressed=this._leftKey,this._wasRightKeyPressed=this._rightKey,this._wasLadderKeyPressed=this._ladderKey,this._wasUpKeyPressed=this._upKey,this._wasDownKeyPressed=this._downKey,this._wasJumpKeyPressed=this._jumpKey,this._wasReleasePlatformKeyPressed=this._releasePlatformKey,this._wasReleaseLadderKeyPressed=this._releaseLadderKey,this._leftKey=!1,this._rightKey=!1,this._ladderKey=!1,this._upKey=!1,this._downKey=!1,this._jumpKey=!1,this._releasePlatfoLine truncated
//# sourceMappingURL=platformerobjectruntimebehavior.js.map
@@ -0,0 +1,2 @@
var gdjs;(function(s){class l{constructor(e){this._platformRBush=new rbush}static getManager(e){return e.platformsObjectsManager||(e.platformsObjectsManager=new s.PlatformObjectsManager(e)),e.platformsObjectsManager}addPlatform(e){e.currentRBushAABB?e.currentRBushAABB.updateAABBFromOwner():e.currentRBushAABB=new s.BehaviorRBushAABB(e),this._platformRBush.insert(e.currentRBushAABB)}removePlatform(e){this._platformRBush.remove(e.currentRBushAABB)}getAllPlatformsAround(e,t,n){const h=e.getWidth(),g=e.getHeight(),m=e.getDrawableX()+e.getCenterX(),d=e.getDrawableY()+e.getCenterY(),a=s.staticObject(l.prototype.getAllPlatformsAround);a.minX=m-h/2-t,a.minY=d-g/2-t,a.maxX=m+h/2+t,a.maxY=d+g/2+t;const c=this._platformRBush.search(a);n.length=0;for(let f=0;f<c.length;f++){const u=c[f].behavior,o=u.owner.getAABB();o.min[0]<=a.maxX&&o.min[1]<=a.maxY&&o.max[0]>=a.minX&&o.max[1]>=a.minY&&n.push(u)}}}s.PlatformObjectsManager=l;const r=class extends s.RuntimeBehavior{constructor(e,t,n){super(e,t,n);this._oldX=0;this._oldY=0;this._oldWidth=0;this._oldHeight=0;this._oldAngle=0;this.currentRBushAABB=null;this._registeredInManager=!1;this._platformType=t.platformType,t.platformType==="Ladder"?this._platformType=r.LADDER:t.platformType==="Jumpthru"?this._platformType=r.JUMPTHRU:this._platformType=r.NORMALPLATFORM,this._canBeGrabbed=t.canBeGrabbed||!1,this._yGrabOffset=t.yGrabOffset||0,this._manager=l.getManager(e)}updateFromBehaviorData(e,t){return e.platformType!==t.platformType&&this.changePlatformType(t.platformType),e.canBeGrabbed!==t.canBeGrabbed&&(this._canBeGrabbed=t.canBeGrabbed),e.yGrabOffset!==t.yGrabOffset&&(this._yGrabOffset=t.yGrabOffset),!0}onDestroy(){this._manager&&this._registeredInManager&&this._manager.removePlatform(this)}doStepPreEvents(e){!this.activated()&&this._registeredInManager?(this._manager.removePlatform(this),this._registeredInManager=!1):this.activated()&&!this._registeredInManager&&(this._manager.addPlatform(this),this._registeredInManager=!0),(this._oldX!==this.owner.getX()||this._oldY!==this.owner.getY()||this._oldWidth!==this.owner.getWidth()||this._oldHeight!==this.owner.getHeight()||this._oldAngle!==this.owner.getAngle())&&(this._registeredInManager&&(this._manager.removePlatform(this),this._manager.addPlatform(this)),this._oldX=this.owner.getX(),this._oldY=this.owner.getY(),this._oldWidth=this.owner.getWidth(),this._oldHeight=this.owner.getHeight(),this._oldAngle=this.owner.getAngle())}doStepPostEvents(e){}onActivate(){this._registeredInManager||(this._manager.addPlatform(this),this._registeredInManager=!0)}onDeActivate(){!this._registeredInManager||(this._manager.removePlatform(this),this._registeredInManager=!1)}changePlatformType(e){e==="Ladder"?this._platformType=r.LADDER:e==="Jumpthru"?this._platformType=r.JUMPTHRU:this._platformType=r.NORMALPLATFORM}getPlatformType(){return this._platformType}canBeGrabbed(){return this._canBeGrabbed}getYGrabOffset(){return this._yGrabOffset}static isOnPlatformTest(e,t,n){return e.getBehavior(n).isOnFloorObject(t)}};let i=r;i.NORMALPLATFORM=0,i.NORMALPLAFTORM=r.NORMALPLATFORM,i.JUMPTHRU=1,i.LADDER=2,s.PlatformRuntimeBehavior=i,s.registerBehavior("PlatformBehavior::PlatformBehavior",s.PlatformRuntimeBehavior)})(gdjs||(gdjs={}));
//# sourceMappingURL=platformruntimebehavior.js.map
@@ -0,0 +1,2 @@
var gdjs;(function(e){let a;(function(t){let n;(function(r){r.isOnPlatform=function(s,o,i,c){return e.evtTools.object.twoListsTest(e.PlatformRuntimeBehavior.isOnPlatformTest,s,i,c,o)}})(n=t.platform||(t.platform={}))})(a=e.evtTools||(e.evtTools={}))})(gdjs||(gdjs={}));
//# sourceMappingURL=platformtools.js.map