This is a script for a ball that bounces on the floor
func _physics_process(delta: float) → void:
velocity.y += gravity
var collision: KinematicCollision2D = move_and_collide(velocity * delta)
if collision:
var reflect = collision.get_remainder().bounce(collision.get_normal())
print(reflect)
velocity = velocity.bounce(collision.get_normal())
move_and_collide(reflect)
However, I have no idea how the bounce() function and the get_remainder() functions work and what exactly they return. I would appreciate if someone broke this down into simple terms so I can understand.