()
| 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) { |
no test coverage detected