Computer Science Canada

pong ball

Author:  scorpion1087 [ Sun Dec 07, 2003 11:11 am ]
Post subject:  pong ball

i have to make a pong game for school and need to make a ball so that when it hits the border i made it will bounce of of it.

oh by the way i cant use graphics mode,only rows and columns!

Author:  AsianSensation [ Sun Dec 07, 2003 1:54 pm ]
Post subject: 

here is couple of tips, have a drawfield procedure to draw the entire background, and then manipulate the locate values to have it bounce. I did post the source a couple of minutes ago, but I have to see what you did first, I can't just give you the code, especially since you are doing this for school. Try it, and it you are really stuck, then I'll re-post the source.

Author:  Blade [ Mon Dec 08, 2003 2:25 am ]
Post subject: 

umm.... if you think about it, to start just have the ball bounce off the edges of the screen...so if the horizontal 0 is the left side of the screen and maxcol would be the right. the vertical 0 would be the top, and maxrow would be the bottom... so if you use a couple if statements to check to see if the ball has hit those... then you can change the direction of the ball..


: