Update script.js

changed all of the ball.x1 and ball.x2 to just ball.x (the center)