Original Post
this wont work it goes straight through the other one. when I have this done I can make a game of pong, my 1-year dream ;)
int pong::collision()
{
//collison decetion
//if they hit each other
if(bypos == ypos-52 && bxpos == xpos-52)
{
ypos = -ypos;
bypos = -bypos;
}
//from the side
if(bxpos == xpos-52)
{
xpos = -xpos;
bxpos = -bxpos;
}
if(bypos == ypos+52)
{
ypos = -ypos;
bypos = -bypos;
}
//from the side
if(bxpos == xpos+52)
{
xpos = -xpos;
bxpos = -bxpos;
}
}