But my restoreHealth method is an placed in my 'RestoreHeart' actor. I think i mentioned that somewhere earlier. I get the same error as before again, but then its refering to getScoreObjects method. I also tried putting this whole method in my 'MenuWorld' world, but it also gives that same error.
non-static method getScoreObjects(java.lang.Class) cannot be referenced from a static context?
So what i changed in my code is;
I placed the the getScoreObject and getHeartObject in my 'BotenUpgrade' and tried to place the restoreHealth in my 'RestoreHeart' actor like this, but it wont compile though.
public void restoreHealth()
{
{
Score score = BotenUpgrade.getScoreObject();
heart hertz = BotenUpgrade.getHeartObject();
if (Greenfoot.mouseClicked(this) && score.getValue() >= 200 && hertz.getValue() < 3)
{
hertz.adjustValue(+1);
//score.getValue(-200);
}
}
}

