Results 1 to 5 of 5

Thread: Bouncing Balls

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Post

    I can make a ball bounce around the screen, but how would i make it bounce of of objects, such as other images?

    Thanx

    Steve

    ------------------


  2. #2
    New Member
    Join Date
    Mar 2001
    Posts
    2

    Unhappy bouncing ball

    Steve can I get a copy of the code to bounce around the screen. I have a school project and have to do a game. Any help will be greatly appreciated. Thanks

    Jason

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Wow how old is this post?

    use this ... imgBall is the ball...

    Code:
    'PUT THIS IN FORM LOAD
    dim x as integer
    dim y as integer
    
    x=75
    y=75
    
    'PUT THIS IN A TIMER
    imgball.top = imgball.top + y
    imgball.left = imgball.left + x
    
    if imgball.top < = 0 or imgball.top >= (form1.height-imgball.height - 30) then
         y = y *-1
    elseif imgball.left< = 0 or imgball.left >= (form1.width- imgBall.widht) then
         x = x *-1
    end if

  4. #4
    Techi
    Guest

    check this!

    Is this what you wanted? My attatchment is a must have for you - check help for abs function!

  5. #5
    New Member
    Join Date
    Mar 2001
    Posts
    2

    Exclamation RE: Bouncing Ball

    Hey, thanks a bunch. That looks like it will help me out well.

    Jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width