
-----------------------------------
The_Triangle
Sat Nov 12, 2005 7:38 am

Need Help- ball won't stay on scroll bar
-----------------------------------
i been trying forever to make this ball bounce off of the paddle (its not pong, but something like it) and its just not happening. 

i tried to make that if the ball_x is equal to the scroll's x, the ball_y would remain on the same y cordinate as the scrolls y. 

New Code:
View.Set ("graphics:max,max,offscreenonly")
%-------------------------------------- ball -------------------------------------------

proc ball (var x, y, mx, my, mb, loadBall, size : int)

    colourback (black)
    cls
    var speed : int := 10

    %Pic.Draw (loadBall, mx - 7, 74, picCopy)
    drawfillbox (mx - 45, 74, 1000, 100, black)     % erases first ball
    y -= 2         % gravity
    drawfilloval (mx + 30, y, size, size, brightblue)
    mousewhere (mx, my, mb)     % click3 to bounce ball off the scrollbar(paddle)
    if mb = 1 then
        y += speed
        %Pic.Draw (loadBall, mx - 7, y, picCopy)
    end if

end ball

%-------------------------------------- moveScroll -----------------------------------------

proc moveScroll (mx, scroll : int)

    drawfillbox (mx + 21, 20, maxx, 80, black)           % old drawBox scroll
    drawfillbox (mx, 20, -20, 80, black)
    drawfillbox (mx, 20, mx + 70, 80, blue)

end moveScroll

%-------------------------------------- collisionDetect ------------------------------------

proc collisionDetect (y, font1 : int)

    if y 