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

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




PostPosted: Thu Mar 29, 2007 8:36 pm   Post subject: Bouncing Squares

I have a couple squares moving around on the screen. These squares may have different x and y velocities at any time. I was wondering how to make them "bounce" off each other realistically. I have the collision code figured out but do not know how to properly alter the velocities. I have read through the forums and have found multiple posts on bouncing circles and was wondering whether using squares would be easier to accomplish and if so, how to begin.

Thanks,

Jon
Sponsor
Sponsor
Sponsor
sponsor
Drakain Zeil




PostPosted: Fri Mar 30, 2007 7:26 am   Post subject: RE:Bouncing Squares

Swap velocities between objects, don't modify them.

If you gave an example of your code it would be easier to help you.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: