ok. here when u do panRoundedCatcher = panCatcher; it doesnt attach it to each other. Instead it copies the parameters from one panel to the other. so wat u need to do is move the panels on mouse move. here is the code (tested) for this:
BMAP* paddle = "paddle.pcx";
BMAP* ball = "ball.pcx";
PANEL* panPaddle =
{
pos_x = 40; pos_y = 40;
bmap = paddle;
flags = SHOW;
}
PANEL* panBall =
{
pos_x = 80; pos_y = 20;
bmap = ball;
flags = SHOW;
}
function setCatcher(PANEL* panCatcher)
{
while(1)
{
panCatcher.pos_x=clamp(panCatcher.pos_x+(time_step*mouse_force.x*50), 0, screen_size.x-bmap_width(panCatcher.bmap)*panCatcher.scale_x);
panBall.pos_x=clamp(panBall.pos_x+(time_step*mouse_force.x*50), 0, screen_size.x-bmap_width(panBall.bmap)*panBall.scale_x);
wait(1);
}
}
function main()
{
setCatcher(panPaddle);
}
in the above code, it just moves. U can add in code for once mouse click, then release the ball.