Cant find the problem
in
Programming Questions
•
1 years ago
Hi im new to processing and have problems with my first "real" program.
It ceeps saying "Syntax error, maybe a missing semicolon?" and highlights a line even if its commented out. (last line of tab) If i paste te contend all tabs in one tab, it highligts a differend line wich sems to be correct to me. I serched for the problem vor ouers now and culdnt find it. Is this a bug in processing?
below i added immages of the error and the code. You wuld realy helb me if someone checks the code for me
same when not outcommented
- int w = 240;
int h = 240;
StickGroup sticks = new StickGroup(); - void setup() {
size(w, h);
smooth();
} - void draw() {
background(204);
} - class StickGroup {
Stick[] sticks;
StickGroup() {
sticks = new Stick[0];
}
void addStick() {
Stick x = new Stick(int(random(w)), int(random(h)), int(random(w)), int(random(h)));
sticks = append(sticks, x);
}
} - class Stick{
int x1, int y1, int x2, int y2;
Stick(int tempx1, int tempy1, int tempx2, int tempy2) {
x1 = tempx1;
y1 = tempy1;
x2 = tempx2;
y2 = tempy2;
}
void update() {
line(x1, y1, x2, y2);
}
}
1