Im new to Java and this site.
Im trying to develop a a game as modular as possible. So I have a GameEngine class and a GUI clase, which are completely independent. And an other class that is the Interface of both.
The problem is that I can't get the GUI Object (where the actionPreformed routine reside) to trigger methods in the GameEngine class. I'm trying to do all the programming in the interface not having to modify any of the other two classes (or at least not make them codependent).
My idea is to have the actionPerformed return a code which is processed in the interface that directs the next action.
As an example, the NewGame button generates a NewGameCode. But how can I trigger the NewGame method in the GameEngine with that code and within the Interface?