It would work, but...something as easy as...?
step event of the racket
racket .x = mouse.x
...it wouldn't stop the racket from going out of the screen.and prevent the racket from going out of the screen from left to right?
racket.x = clamp(mouse_x, 64, room_width - 64);