Permalink
Browse files

Add terminal velocity.

  • Loading branch information...
kevadsett committed Sep 13, 2016
1 parent 1e333db commit 59a6666d11538995cd83a97427c0995af7975ee2
Showing with 2 additions and 0 deletions.
  1. +1 −0 src/js/Constants.js
  2. +1 −0 src/js/controllers/PlayerController.js
View
@@ -4,6 +4,7 @@ var FRICTION = 0.8;
var GRAVITY = 2500;
var JUMP_STRENGTH = 1000;
var MAX_JUMPS = 1;
var TERMINAL_VELOCITY = 2500;
var DEATH_TIMING = 500;
var DEATH_SHARD_COUNT = 15;
@@ -109,6 +109,7 @@ PlayerController.prototype = {
},
adjustYVelocity: function() {
this.model.velocity.y += GRAVITY * this.lastFrameTime;
this.model.velocity.y = Math.min(this.model.velocity.y, TERMINAL_VELOCITY);
},
checkCollisions: function() {
this.pointA = this.model.position;

0 comments on commit 59a6666

Please sign in to comment.