Progressive speed



I created a speed variable for the player and I would need that if the variable is set to 0, make it rise progressively up to 50.
when the variable is 0 and I reset the player speed to player.speed (50) it is accelerated too much.

Use a tween gradually increase the force applied:

  1. Change the name of the variable speed to maxSpeed, and add another variable currentSpeed, initial value 0.

  2. Tween currentSpeed to player.maxSpeed over the time you’d like the acceleration to take.

  3. In the event you posted, change the player.speed to player.currentSpeed.