Separated collision for the X and Y axis to their own if-else
statements.