nature-of-code / noc-examples-processing

Repository for example code from The Nature of Code book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#circle checkEdges() error : chp01_vectors\NOC_1_7_motion101

Aweistory opened this issue · comments

commented

we can add radius 24(48/2),display will be right
void checkEdges() {

if (position.x > width + 24) {
  position.x = 0;
} 
else if (position.x < 0 - 24) {
  position.x = width;
}

if (position.y > height + 24) {
  position.y = 0;
} 
else if (position.y < 0 - 24) {
  position.y = height;
}

}