Fix the defect of moving to the left and right.

I didn't take the y coordinate when I implement move to left or right.