Hi. I'm an instructor using Processing for the first time in a class where we just started using Processing instead of Phrogram for intro game programming (formally, algorithmic thinking and art).
I have a small problem I've been unable to resolve. After a lot of searching, probably just in the wrong places, I cannot for the life of me locate where there is information on the preprocessor which turns a "sketch" into Java code. You would think that "what is the appropriate grammar for a sketch" would be the most basic question of all, but I can't find it documented or even in the tutorials!
The best I can determine is that either a sketch consists of one of two things:
1) A sequence of statements that one could place inside the body of a main() method (or a static initialization block), OR
2) ...a sequence of statements which are treated as static variable declarations only(?), followed afterwards by any number of methods and/or nested classes, which may optionally include overridden versions of setup() and draw(), and are used with a single instance of whatever class this beast is in.
I have had to run tests to see which things work and which don't, and I have not yet exhausted all possibilities. Exactly what is and what is not valid grammar for a sketch is driving me nuts (and regrettably I don't have a lot of time to futz with it this semester), so please point me to the resource that explains this simple concept, or else if you could give me the link to the preprocessor code that I was not able to locate under a cursory examination of the source, that would be fine too (I'll just unravel how it's done). I must have missed this somewhere obvious, so I apologize for the question! But perhaps this information should be easier to find, either way...