Skip to content

Commit

Permalink
now acc reset should be working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
pouyamer committed Mar 1, 2024
1 parent 81ec645 commit 331ef86
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Classes/firefly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,17 +804,20 @@ class FireFly {
this.config.x = edge
this.config.speedX = -afterImpactSpeedMultiplier * this.config.speedX
this.config.rotationSpeed *= rotationSpeedMultiplierAfterImpact
this.config.accelerationX = this.utilGetRandomNumberBetween(
this.appConfig.fireflies.movement.accelerationX
)

if (accelerationXRegenrationAfterImpact)
this.config.accelerationX = this.utilGetRandomNumberBetween(
this.appConfig.fireflies.movement.accelerationX
)
}
if (edgeAxis === "y") {
this.config.y = edge
this.config.speedY = -afterImpactSpeedMultiplier * this.config.speedY
this.config.rotationSpeed *= rotationSpeedMultiplierAfterImpact
this.config.accelerationY = this.utilGetRandomNumberBetween(
this.appConfig.fireflies.movement.accelerationY
)
if (accelerationYRegenrationAfterImpact)
this.config.accelerationY = this.utilGetRandomNumberBetween(
this.appConfig.fireflies.movement.accelerationY
)
}

// impact increases/decreases the hue
Expand Down

0 comments on commit 331ef86

Please sign in to comment.