I am having trouble with my moving dot program. I have it to where the dots move to the right like they are supposed to, but how do I get them to loop back around so it looks like they are continuously going by rather than moving off the page? The block of code I need to edit to make this happen is below. I hope someone can help and thanks again in advance!
1 2 3 4 5 6 7 8 9
void advanceDots(XPoint dots[], unsigned num_dots, XWindowAttributes &w){
int s = num_dots;
for(s = 0; s < num_dots; s++){
if(s < num_dots){
dots[s].x++;
}
}
}
Thank you so much for your answer but this didn't work. I was given a hint that said I need to determine when the x position is too high and the dots go off the page. Then, I need to change x back to 0 to make the dots go back to their original position.