Issues with AI move_and_slide()

Please format your code correctly so it is readable.

Also tell us how it is different from the code that works.