Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerenaux committed Mar 18, 2017
1 parent f6f99a3 commit e26c4c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/server/MovingEntity.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ MovingEntity.prototype.updateWalk = function(){
this.lastWalkUpdate = Date.now();
var previousX = this.x;
var previousY = this.y;
// this.speed is the amount of time need to travel a distance of 1 tile;
// delta = the number of tiles traveled since departure
var delta = Math.ceil(Math.abs(Date.now() - this.route.departureTime)/this.speed);
var maxDelta = this.route.path.length-1;
if(delta > maxDelta) delta = maxDelta;
Expand Down

0 comments on commit e26c4c2

Please sign in to comment.