move_and_collide internally. It just calls
move_and_collide again once collision is occurred until there is no movement left or
max_slides calls of
move_and_collide used. If you want to replace
move_and_collide, then you need to use same approach. After each collision you can get remain velocity (it is returned by
move_and_collide function) and call
move_and_collide again adjusting velocity along collision's normal. Do it until remaining velocity is not zero (or at least close to zero) or max calls per frame is reached (you need to limit it too, because it might collide multiple hundreds times at some cases, freezing game).