| 318 | } |
| 319 | |
| 320 | ApplyGravity() { |
| 321 | if (!this.isOnGround) { |
| 322 | if (this.isSlidding) { |
| 323 | this.currentSpeed.y = min(this.currentSpeed.y + gravity * 0.5, terminalVelocity * 0.5); |
| 324 | if (this.sliddingRight) { |
| 325 | this.currentSpeed.x = min(this.currentSpeed.x + gravity * 0.5, terminalVelocity * 0.5); |
| 326 | } else { |
| 327 | this.currentSpeed.x = max(this.currentSpeed.x - gravity * 0.5, -terminalVelocity * 0.5); |
| 328 | } |
| 329 | } else { |
| 330 | |
| 331 | this.currentSpeed.y = min(this.currentSpeed.y + gravity, terminalVelocity); |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | |
| 337 | ApplyBlizzardForce() { |