Star Drifter - a multi level, gravity based space game (play here).
The following diagram presentes the use cases implemented by the game.
Figure 1. Game states.
The Scheduler is a virtual actor implemented by the platform providing time related event mechanism.
The following digram shows building blocks of the game.
Figure 2. Game components.
Green components are platform independent. Red components are platfrom (browser) specific.
The game operates acording to the following state machine implemented jointly by Presenter and User Interface.
Figure 3. Game states.
Purple denotes passive initial state when Player is expected to start the game. Blue denotes active states when persiodic screen refreshes governed by Scheduler take place. Green denotes passive states where no screen refreshes take place, and Player decition is awaited.
The main event loop of the game controlled by Scheduler is depicted below.
Figure 4. Main game loop.
The game has been written in Java with the use of Google Web Toolkit as browser adaptation mechanism. The game is ment to be portable across many Java implementations (client side web with GWT, desktop with Swing or SWT, Andorid).
Figure 5. Compile time dependencies.
The organization of code dependencies follows hexagonal architecture with platform independent core logic and platform adapters. The clean seperation is acheved with a combined use of the following design patterns:
Automatic game testing is done mainy through unit testes with the help of test doubles used for controling inputs and sensing outputs. The only unit exlicitely under test is Presenter. Verification of other portable components is done indireclty through verification of observable behavior of Presenter. In this case a unit is understood as entire platform-independent part of the game.
Figure 6. Tests setup.
User Interface, Scheduler and Space Factory are intentionally not tested automaticaly.
The game is deployed on Google AppEngine platform.