I missed something first time around here. You cannot use removeObject on a class -- it requires an Actor object. Chance "Coin.class" in line 6 to "coin". You seem to have dropped the first line in your act code (Actor coin;).
"coinNum + 1" is not storing any value in a variable. If you want to add 1 to an int variable you should do:
coinNum++;
// same as
coinNum = coinNum + 1;
danpost's "no" is meant to be going on the first part of your last post not the second part.
Also, to change to a new world you should do "Greenfoot.setWorld" not "getWorld" (like you were wrongly told).
to change to a new world you should do "Greenfoot.setWorld" not "getWorld" (like you were wrongly told).
That must of been a senior moment when I posted this:
danpost wrote...
Change "Greenfoot" to "getWorld" on lines 7 and 12 (getWorld is a World object method -- not a Greenfoot class method).
I should not have included line 12 and neither line uses the getWorld method and that method is an Actor object method , not a World object method. It should have said:
Change "Greenfoot" to "getWorld" on lines 7 (removeObject is a World object method -- not a Greenfoot class method).