Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 pong ball
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
scorpion1087




PostPosted: 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!
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: 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.
Blade




PostPosted: 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..
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: