Jump to content
  • Advertisement

Archived

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

Camel6

Old school collision detection

This topic is 6651 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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!