MrCzeal
MrCzeal

Reputation: 55

libGDX Design Pattern

I just recently bumped in to libGDX for android game development. I still can't program using such engine since I have no clue as to what design pattern is being used.

Does libGDX use Adapter pattern? considering that it has Screen Class, which is some sort of adapter that is being managed by Game Class, or it uses a different design pattern?

Upvotes: 2

Views: 1131

Answers (1)

Madmenyo
Madmenyo

Reputation: 8584

You are not tied to any design pattern. You are simply handed a starter class where you can write your game logic however you decide. LibGDX comes with a ton of classes that help you out, such as the Screen class you mentioned. Screen uses the observer pattern. The ApplicationListener or rather the application of the different modules/platforms is the subject and any screen you want to create is the observer/listener, Screen is the interface to communicate between them. But you actually do not need to know all this.

On a more general note, you code all the none platform specific stuff in the core module. Here you can start right away with your game logic and in most cases it should "just" work when running on either of the modules/platforms.

Upvotes: 5

Related Questions