MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / clone

Method clone

Player.js:106–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 }
105
106 clone() {
107 let clone = new PlayerState();
108 clone.currentPos = this.currentPos.copy();
109 clone.currentSpeed = this.currentSpeed.copy();
110 clone.isOnGround = this.isOnGround
111
112
113 clone.blizzardForce = this.blizzardForce;
114 clone.blizzardForceAccelerationDirection = this.blizzardForceAccelerationDirection;
115 clone.maxBlizzardForceTimer = this.maxBlizzardForceTimer;
116 clone.snowImagePosition = this.snowImagePosition;
117
118
119 clone.bestHeightReached = this.bestHeightReached;
120 clone.bestLevelReached = this.bestLevelReached;
121 clone.reachedHeightAtStepNo = this.reachedHeightAtStepNo;
122 clone.bestLevelReachedOnActionNo = this.bestLevelReachedOnActionNo;
123 clone.brainActionNumber = this.brainActionNumber;
124
125 clone.currentLevelNo = this.currentLevelNo;
126 clone.jumpStartingHeight = this.jumpStartingHeight;
127 clone.facingRight = this.facingRight;
128
129
130 // clone.isWaitingToStartAction = this.isWaitingToStartAction;
131 // clone.actionStarted = this.actionStarted;
132 return clone;
133 }
134
135
136}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected