Skip to content

Commit

Permalink
Merge pull request #393 from android/jmylen-hs-bounce-effect
Browse files Browse the repository at this point in the history
Adjust the collision with floor to account for the wobbly floor effect.
  • Loading branch information
jmylen committed Oct 24, 2022
2 parents 137e7a7 + b510cb8 commit 39f319a
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,10 @@ private fun updateCollisionData(transitionData: TransitionData): BallCollisionDa
val ballOffsetY = transitionData.ballOffsetY
return BallCollisionData(
collisionWithFloor = transitionData.isBouncing &&
ballOffsetY >
-(DISTANCE_FROM_END_POSITION_FOR_COLLISION) && ballOffsetY < BALL_END_POSITION,
ballOffsetY > -(DISTANCE_FROM_END_POSITION_FOR_COLLISION),
collisionWithReset = transitionData.isResetting &&
ballOffsetY > BALL_START_POSITION &&
ballOffsetY < (BALL_START_POSITION + DISTANCE_FROM_START_POSITION_FOR_COLLISION)

)
}

Expand Down

0 comments on commit 39f319a

Please sign in to comment.