Hi, I'm still relatively new to processing, and I was wondering why there are so many unexpected tokens within my program please? I know when it gives that error, it either means, I'm missing a bracket or semicolon, but neither of those are the problem here (that I can see anyways). And if there's an error, it is usually located above the line it highlights. The line that it highlights is void setup() {, but I'm sure the program probably has more than just this error
Here's the code and a brief description of what I am trying to do:
/**
* A new line of API feed is retrieved from Twitter - wishes category
* each time a star is clicked on. I want the stars to be positioned
* randomly all over the screen mimicking a starry night where one
* hopes to find a shooting star that will grant his or her wishes.
*
* flo
**/
PImage star;
PFont bookAntiqua;
bookAntiqua = loadFont("BookAntiqua.ttf");
XMLElement xml;
Star[] stars = new Star[100]; //100 stars in total
//int index = 0;
void setup(){
size(800, 600);
background(0);
myFont = createFont(bookAntiqua, 12);
textFont(myFont);
//Load RSS Feed
String url = "http: // search. twitter. com/search? q=wish";
xml = new XMLElement(this, "http:/ /search. twitter. com/ search?q=wish");
println(xml);
star = loadImage("star3.png");
}
void draw() {
background(0);
for (int i = 0; i < index; i++) { //what exactly does this do?
stars[i].render();
}
}
void mousePressed() {
//if your mouse is in the centre of the image, then that image
//will be mouseOvered
boolean mouseOver() { //booleans return true/false
float xDist = abs(xpos + size/2 - mouseX);
float yDist = abs(ypos + size/2 - mouseY);
//if mouse is over heart (within the size/2) then say true
if(sqrt(sq(yDist) + sq(xDist)) < size/2 ) {
return true;
}
else {
return false;
}
}
}
void addStar () {
String message = "(content.getChild("Subject")).getContent()";
}
// clicking on star method
void mouseReleased() {
if(capturedStar != null) {
if(capturedStar.clicked) { //when clicked
capturedStar.clicked = false;
text(message, width+3, height+5);
}
else if(!capturedStar.clicked) { //not clicked
capturedStar.clicked = true;
}
}
}
***********
Thank you for any suggestions as to why and where the errors are. :]