I create two Actors (startGame1, tutorialButton1) in a world and I want to give the actor startGame1 the tutorialButton1 and then just the other way around. I typed this:
Of course it gave me an error: "illegal forward reference", marking "tutorialButton1".
If I just swap the lines like this:
it is the same, but it marks "startGame1".
I think this is, because I try to give an actor that has not been created yet. However, I can't really figure out any way to solve the problem.
Thanks for your help in advance.
StartGame startGame1 = new StartGame(tutorialButton1); TutorialButton tutorialButton1 = new TutorialButton(startGame1);
TutorialButton tutorialButton1 = new TutorialButton(startGame1); StartGame startGame1 = new StartGame(tutorialButton1);



