🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

nooone's devlog

A topic by nooone created Dec 28, 2015 Views: 241,860 Replies: 1
Viewing posts 1 to 2

I started working on my game entry quite too late, but it's just for fun anyway. It's finally a chance to finish a game and "publish" it for others to play, however far I get.

The base of the project seems to work now. It will be a pretty standard top-down shooter in space, but with a survival touch ("Life in Space"). I hope that's enough to fit the theme of the jam. Here's how it currently looks like:

I've decided to try something new in the "architecture" of this game. In the past I've always used a lot of static fields to globally access some unique things. Everyone who knows the pitfalls of Android will understand that it can lead to problems and is overall not a really clean way to do that.

A more clean way of getting the "dependencies" I need, anywhere I want them, is via Dagger 2. This still uses statics to store the "Access Points" to the dependency producers, but in a more advanced way via Scopes (for example "Singleton"- or "Game"-Scope). Dagger 2 also does not make use of reflection, but generates code at compile-time, so it is really fast.

Getting the globally unique World object for the current game (a new game starts every time you die), looks like this:

DI.getGameComponent().physicsSubSystem().world

The same is used for SpriteBatch, the Viewport, AssetManager, UI Stage etcetc. In total a really clean, powerful and comfortable way to access what you need, from anywhere you want. I can definetely advice other devs to try it.