code to move ball