Funny. I look through those blocks of code and seriously did not see that. It might have been because he had called it 'subclasses' instead of 'superclass'. Yes, if the 'WMethod' world extends 'World' and the the other classes that use the score object extend 'WMethod', then they will all share the same field (albeit, with seperate values). The 'setScore' method I gave above should then be placed in the 'WMethod' world code. It might be better to have the 'setScore' method actually add the score object into the world:
You can then use this in your initial world in creating and setting up the score object with the following:
If you continue to get error messages and are not able to correct the code, please post the message you are getting plus the area in the code where the error is occuring.
public void setScore(Score scoreObj) { theScore = scoreObj; addObject(theScore, 100, 640); }
Score score = new Score(); setScore(score);