Re: A86: Breakout in Visual Basic [OT]


[Prev][Next][Index][Thread]

Re: A86: Breakout in Visual Basic [OT]




the typical way to have a bouncing ball is to have x and y change
variables that are added to the current position when you wish to move
the ball.  when you bounce off of an edge, you negate the appropriate
change variable and the ball moves the opposite direction.  if you have x
and y changing by the same amount (x change = y change) then the ball
will move at 45 degrees.  to get other anges, make the change varaibles
be different values, for example, have the x change be 0 if the ball hits
the center of the paddle, 1 if it hits a little to the right, -1 if it
hits a little to the left, etc.

-josh

On Wed, 24 Nov 1999 17:27:59 CST "Barcode [ASM86]"
<andycool2@hotmail.com> writes:
>
>I am making Breakout in Visual Basic for my class at
>school. I have the paddle movement working with liquid
>motion, but I wasn't really sure about the ball
>movement. I could just move it in 4 directions
>(NorthEast, SouthEast, SouthWest, and NorthWest), but
>it just doesn't lok very nice like Breakout on the
>calcs. How exactly would I make it go off on different
>angles. I am using a shape for the ball. If I used
>Pset(x,y) would that be the way to go? I recall
>someone asking about the angles on here, but that was
>in asm which doesn't really use shapes like VB can.
>Any help or just suggestions would be very helpful.
>
>        -Barcode (Andy D.)
>        http://nft.cjb.net
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.