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

Method Update

Player.js:291–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289 }
290
291 Update() {
292 if (this.playersDead)//|| this.hasFinishedInstructions)
293 return;
294 let currentLines = levels[this.currentLevelNo].lines;
295 if (!testingSinglePlayer && !this.hasFinishedInstructions) {
296 this.UpdateAIAction()
297 }
298 this.UpdatePlayerSlide(currentLines);
299 this.ApplyGravity()
300 this.ApplyBlizzardForce();
301 this.UpdatePlayerRun(currentLines);
302 this.currentPos.add(this.currentSpeed);
303 this.previousSpeed = this.currentSpeed.copy();
304
305 this.currentNumberOfCollisionChecks = 0;
306 this.CheckCollisions(currentLines)
307 this.UpdateJumpTimer()
308 this.CheckForLevelChange();
309 this.CheckForCoinCollisions();
310
311 if (this.getNewPlayerStateAtEndOfUpdate) {
312 if (this.currentLevelNo !== 37) {
313 this.playerStateAtStartOfBestLevel.getStateFromPlayer(this);
314 }
315 this.getNewPlayerStateAtEndOfUpdate = false;
316 }
317
318 }
319
320 ApplyGravity() {
321 if (!this.isOnGround) {

Callers 2

drawFunction · 0.45
drawFunction · 0.45

Calls 10

UpdateAIActionMethod · 0.95
UpdatePlayerSlideMethod · 0.95
ApplyGravityMethod · 0.95
ApplyBlizzardForceMethod · 0.95
UpdatePlayerRunMethod · 0.95
CheckCollisionsMethod · 0.95
UpdateJumpTimerMethod · 0.95
CheckForLevelChangeMethod · 0.95
getStateFromPlayerMethod · 0.80

Tested by

no test coverage detected