Jump to content
  • Advertisement
Sign in to follow this  
cplus programmer

functions not working

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

it wont do anything in a func, I did do some tests and it is going there. this is one of the rebel funcs:
int pong::collision()
{
    //collison decetion
    //if they hit each other
    if(bypos == ypos-52 && bxpos == xpos-52)
    {
        ypos = -ypos;
        bypos = -bypos;
    }
    
    if(bypos == ypos+52 && bxpos == xpos+52)
    {
        ypos = -ypos;
        bypos = -bypos;
    }
    printf("did go to collision\n");
}    


it does go to the collision every time, but it wont reset the value.

Share this post


Link to post
Share on other sites
Advertisement
could you post the rest of the class, i think you are not setting up your private members correctly. However i can not tell because you have not posted your C++ class.

Also you are using constants to define this, i would use a rect strucutre to setup the bounding box then look at collision and the way it is supposed to be done. Be googling bounding box collision.



- Mike

[Edited by - mxrss on November 9, 2004 11:54:28 AM]

Share this post


Link to post
Share on other sites
Your comparisons are most likely to be the problem. Under which coditions do you 'repel'.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!