vendredi 1 octobre 2021

What is a good way to integrate an UI into logic? [closed]

I am developing the UI (with java libgdx) for an existing Java game which supports only console output currently. The logic is a seperate Project and I developed the UI seperately, becouse some other developers are continueing to develop the game in the meantime and I am at vacation and can't access the repository of the main game from here.

I am at the point where I want to integrate/control the UI from the main game logic, but I think a clever way to not hardwire these two components would be nice, but I lack some experience.

Has anyone a Tip?

Some more information:

  • It's a Java learning game. You program a small Java class as the "brain" of a bee colony and your goal is to collect honey. --> UI has to represent every movement of every bee --> many position changes.
  • The main game has classes to represent bees and store data like their y and x coordinates and the UI has the same, just a bit different.
  • The game works in rounds. Every round each bee moves 10 steps or does something else
  • Maybe a problem: The main game is Maven, the UI depends on Gradle. Gradle for the main game is not preferable.

I am asking for general advice. Maybe a pattern suggestion and maybe some experience about wether using a complex pattern is worth it or not? It is a relatively small Project, although it got a bit complex.

The only thing I can think of is to write some kind of mapping to map game logic to some ohter format in some kind of huge Data class with every necessary Data for each game round -> pass that to the UI and process it. This could get a bit ugly, but it would be easier to maybe change the UI later.

Any other suggestions?

Aucun commentaire:

Enregistrer un commentaire