Skip to content

Commit

Permalink
Fix issue #129 - PathParticle throws error when no speed interp
Browse files Browse the repository at this point in the history
  • Loading branch information
MxAshUp committed Apr 29, 2020
1 parent df3ca2c commit 7e57341
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/PathParticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,13 @@ export class PathParticle extends Particle
if(lerp >= 0 && this.path)
{
//increase linear movement based on speed
const speed = this.speedList.interpolate(lerp) * this.speedMultiplier;
this.movement += speed * delta;
if(this._doSpeed) {
const speed = this.speedList.interpolate(lerp) * this.speedMultiplier;
this.movement += speed * delta;
} else {
const speed = this.velocity.x;
this.movement += speed * delta;
}
//set up the helper point for rotation
helperPoint.x = this.movement;
helperPoint.y = this.path(this.movement);
Expand Down Expand Up @@ -215,4 +220,4 @@ export class PathParticle extends Particle
}
return output;
}
}
}

0 comments on commit 7e57341

Please sign in to comment.