pong ball
Author |
Message |
scorpion1087
|
Posted: 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! |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
AsianSensation
|
Posted: Sun Dec 07, 2003 1:54 pm Post subject: (No 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. |
|
|
|
|
![](images/spacer.gif) |
Blade
|
Posted: Mon Dec 08, 2003 2:25 am Post subject: (No 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.. |
|
|
|
|
![](images/spacer.gif) |
|
|