what am i doing wrong here (syntax)?
in
Programming Questions
•
1 year ago
i have typed out
example 5 - 1 from Learning Processing, and on two different machines i am getting an error at the line of my first if statement (line 16 below). i am worried i am mistyping a character or something?
- float r = 150;
- float g = 0;
- float b = 0;
- void setup(){
- size(200,200);
- }
- void draw(){
- background(r,g,b);
- stroke(255);
- line (width/2, 0, width/2, height);
- }
- if(mouseX > width/2){
- r = r + 1;
- } else{
- r = r - 1;
- }
- if (r > 255){
- r = 255;
- } else if (r < 0){
- r = 0;
- }
- }
1