Hi! I'm making a breakout clone (well, it's a breakout clone right now) and I'm having a bit of trouble. The paddle is controlled by the mouse, but unlike being controlled by keys, I can't figure out a way to keep it within the boundaries (the green boxes). Currently it's set to just always follow the mouse's X position, which obviously won't work. As is, it's fine with just going right past the boundaries and off the screen.
I have also tried making a big sprite/tiled bg and making it so the paddle only follows the mouse when it's over the sprite, i.e. inside the boundaries. But that only kind of worked, because moving too fast from one end to the other causes the mouse to leave the sprite before the paddle catches up to it on the next frame.
I'm probably just having a brain fart, but I really can't figure it out. Any advice?