Skip to content

Commit

Permalink
Adjust the collision with floor to account for the wobbly floor effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmylen committed Oct 20, 2022
1 parent bab8c83 commit b510cb8
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 b510cb8

Please sign in to comment.