I thought i got the thing right by searching on this forum i still don't get it... So i want to Have my method "setCharacter" to another class. Here is the code for it. Can someone help me please?
public void setCharacter(String ch)
{
setImage(ch);
} public void enterGame()
{
MouseInfo info = Greenfoot.getMouseInfo();
SpelCharacter main = new SpelCharacter(); // there is something wrong in this line?
if(info!=null) {
int clicked = info.getButton();
if(Greenfoot.mouseClicked(this) && clicked==1) {
getWorld().removeObject(this);
Greenfoot.setWorld(new Spel());
SpelCharacter.setCharacter("hedgehog.pjg"); // here i get an error too
}
}
}
}
