Posted by & filed under funtimes.

I’ve been working very steadily on a tower defense game for Android for the last couple of weeks, utilizing libgdx.

The current state of the game has a limited number of configurable towers that deal damage to enemies in configurable ways. Enemies try to find their way around a maze created by tower placements using my dirty A* implementation *wink*.

The games SLOC grew very rapidly despite trying to avoid known cruft. This was fine until I started implementing the smaller things that sew the experience together for both myself, and the user. Certain areas started becoming obese, and as a result I began doing things that no longer felt right. Cruft-mode activated.

I was aware from the beginning that I was essentially picking up a machete and hacking into the wilderness, and so I decided to stop feeling shit about the new code I was writing and look into the approach suggested through the use of entity systems. I’m using a database-like approach similar to that described at the bottom of this article. I’m almost completely sure that I still have no fucking idea what I’m doing, but regardless, it was a good idea. I’ve gone from machete hacking through the wilderness to machete hacking through the wilderness with a flamethrower.

Much more fun.