PDA

Click to See Complete Forum and Search --> : Bouncing Balls


SteveCRM
Aug 7th, 1999, 03:48 AM
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

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

kb9yjg
Apr 2nd, 2001, 08:14 PM
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

SteveCRM
Apr 2nd, 2001, 08:22 PM
Wow how old is this post? :D

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


'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

Techi
Apr 4th, 2001, 02:00 PM
Is this what you wanted?:D My attatchment is a must have for you - check help for abs function!;)

kb9yjg
Apr 4th, 2001, 11:22 PM
Hey, thanks a bunch. That looks like it will help me out well.

Jason