Hi!
So for my Greenfoot game I have two doors: a correct door and a wrong door, and these are both in separate classes. When the correct door is clicked, I would like to be able to switch that image as well as switching the image from the wrong door class.
I have created a method in the wrong door class which switches its image, and have called the class by "WrongDoor.switchtoSecond()"
However, when compiled, the bolded line of code says
"non-static method switchtoSecond() cannot be referenced from a static context"
How would I be able to fix this?
public void firstCAnswer() { if (Greenfoot.mouseClicked(this)) { setImage(new GreenfootImage("3-correct.png")); [b]secondCAnswer();[/b] WrongDoor.switchtoSecond(); } }