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

Method ResetPlayer

Player.js:219–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

217 }
218
219 ResetPlayer() {
220 this.currentPos = createVector(width / 2, height - 200); // this is the top left corner of the hitbox
221 this.currentSpeed = createVector(0, 0);
222 this.isOnGround = false;
223
224 this.jumpHeld = false;
225 this.jumpTimer = 0;
226 this.leftHeld = false;
227 this.rightHeld = false;
228
229
230 this.facingRight = true;
231 this.hasBumped = false;
232 this.isRunning = false;
233 this.isSlidding = false;
234 this.currentRunIndex = 1;
235 this.sliddingRight = false;
236
237 // this.currentLevel = null;
238 this.currentLevelNo = 0;
239
240 this.jumpStartingHeight = 0;
241 this.hasFallen = false;
242
243 this.blizzardForce = 0;
244 this.blizzardForceAccelerationDirection = 1;
245 this.maxBlizzardForceTimer = 0;
246 this.snowImagePosition = 0;
247
248
249 // ai shit
250 this.aiActionTimer = 0;
251 this.aiActionMaxTime = 0;
252 this.isWaitingToStartAction = false;
253 this.actionStarted = false;
254
255 this.brain.currentInstructionNumber = 0;
256 this.currentAction = null;
257
258 this.playersDead = false;
259 this.previousSpeed = createVector(0, 0)
260 this.bestHeightReached = 0;
261 this.reachedHeightAtStepNo = 0;
262
263 this.fitness = 0;
264 this.hasFinishedInstructions = false;
265
266
267 }
268
269 clone() {
270 let clone = new Player();

Callers 1

ResetAllPlayersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected