Ho yes Noah it's a picky language! I've used PHP and JS and none care about that difference
OK so I've corrected the string problem. Thanks to you two.
About the bonus question : If I don't annouce my Object at the top, Processing stops at the line 9... :
Code:stick1 = new Stick("", "", 10, 10, 20, 20);
...arguing that it cannot find anything names stick1.
-____-
Well guess what Processing, I'm creating the object you're talkin' about!
So I understand the scope difference but not why Processing acts so dull with me
Also, I get an error about line 43 and I think the following 3 will do the same. "Null pointer". Is there something wrong with the way I set my arrays up?
The corrected code :
Code:Stick stick1;
void setup() {
size(640, 360);
}
void draw() {
background(255);
stick1 = new Stick("", "", 10, 10, 20, 20);
}
class Stick {
// The color of the stick
color colour;
// The thickness of the stick
int thickness;
// How stretchable the stick is
int stretch;
// The stick first coordinates
int[] acoord;
// The stick second coordinates
int[] bcoord;
// How "sticky" the stick is
int stickiness;
// Its weight
int weight;
// The A end (first coordinates) attached stick (another stick's name)
String ahandler;
// The B end attached stick
String bhandler;
// Wether the A "spring" elbow attracts (A) or repeals (R) or is loose (L)
char aspring;
// Same for the B "spring"
char bspring;
// An array containing the names of the elements it can pierce through. The other ones block it
char[] through;
Stick(String t_ahandler, String t_bhandler, int t_acoordX, int t_acoordY, int t_bcoordX, int t_bcoordY) {
colour = #000000;
thickness = 1;
ahandler = t_ahandler;
bhandler = t_bhandler;
acoord[0] = t_acoordX;
acoord[1] = t_acoordY;
bcoord[0] = t_bcoordX;
bcoord[1] = t_bcoordY;
line(acoord[0], acoord[1], bcoord[0], bcoord[1]);
}
}