Newbie Questions about if(whatever) command
in
Programming Questions
•
4 months ago
So I'm new to processing and been trying to teach myself but I'm stuck here:
int CircleX = 0;
int CircleY = 0;
int CircleY = 0;
void draw() {
background(255,0,0);
CircleX = CircleX + 1;
CircleY = CircleY + 1;
ellipse(CircleX,CircleY,20,20);
if(CircleX=5);
background(0,0,255);
}
background(255,0,0);
CircleX = CircleX + 1;
CircleY = CircleY + 1;
ellipse(CircleX,CircleY,20,20);
if(CircleX=5);
background(0,0,255);
}
I'm wondering why when I use the if(CircleX=5); it says can not convert from int to Boolean. Does it mean it cannot use the CircleX inside the if(command)? Also I tried putting it outside with it looking like:
int CircleX = 0;
int CircleY = 0;
int CircleY = 0;
void draw() {
background(255,0,0);
CircleX = CircleX + 1;
CircleY = CircleY + 1;
ellipse(CircleX,CircleY,20,20);
}
background(255,0,0);
CircleX = CircleX + 1;
CircleY = CircleY + 1;
ellipse(CircleX,CircleY,20,20);
}
if(CircleX=5) {
background(0,0,255)
background(0,0,255)
}
But then it says looking for EOF found "if". Any ideas for how to get this to work.
But then it says looking for EOF found "if". Any ideas for how to get this to work.
Sorry for the beginner question.
1