Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Old school collision detection

This topic is 6825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am in need of help for my simple collision program. The program only bounces objects around the screen and then decided which collide using the rectangle method. Main loop code is as follows: //loop for objects for(int lcv = 0; lcv < MAX - 1; ++lcv) { int i = lcv + 1; while( i < MAX) { char col = collision(.....);//rectangle collision detection...returns 0 if none...1 if there is a collision if(col == 1 /*not sure if i need other things to check for*/) { //I need to know how to manipulate the variables to adjust the bounce correctly for the object //I need invert the step of the object but i need to invert y at certain time and x at certain times //i.e. (object)--><--(object) you change x //i.e. (object) / v ^ / (object) you change y I''d appreciate any help given. Thanks!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!