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

Method ApplyGravity

Player.js:320–334  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers 1

UpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected