ABSTRACT

I recently had to make edits to a game where the developer had, for the supposed sake of simplicity and speed, put virtually all of the code for the game, menu screens, and results screen in the same document class. Needless to say, it was an organizational nightmare. There was absolutely nothing separating game logic from the navigational structure or the leaderboard code. I’m sure at the time this kept the developer from having to switch between fi les, but it came with an ultimately very high cost. The code was one ugly step up from just having it all tossed on the fi rst frame of the timeline. Here are the steps the developer should have taken to improve the readability and editability of his code, in order of importance:

● Move all game logic to its own class. At the bare minimum, any code that controls the mechanics of a game should be encapsulated by itself, away from irrelevant information. This is the core of the game and the most likely candidate for reuse; it should not be lumped in with everything else.