Autor: |
Mohammad Sameer Sunhaloo, R. Thomas, Jeetendre Narsoo |
Rok vydání: |
2009 |
Předmět: |
|
Zdroj: |
The Journal of Object Technology. 8:153 |
ISSN: |
1660-1769 |
DOI: |
10.5381/jot.2009.8.5.a4 |
Popis: |
In this paper, we demonstrate the use of design patterns to develop games for mobile devices on the J2ME platform. We believe that the proposed idea will help J2ME game developers to write better re-usable code faster. We consider a single player Sudoku board game which is based on the model-view-controller architecture. The view is configured with a Game Controller Choice pattern so that different controllers can be selected. The view and the model implement the Game State Observer pattern. The Canvas drawing logic is created using the Drawing Template pattern, which ensures reusability of the board size computation as well as provides a means for the programmer to implement game specific drawing functionalities. A generic undo method is provided using the Game Memento pattern. Setting of the current display is achieved through the Change Screen pattern. We note that the use of patterns in the Sudoku game makes it possible to cater for changes without breaking up the overall architecture of the game. By considering a downgraded version of the standard Soduko game, we show that patterns allow modifications to be made without opening up too many classes. We also show how the proposed design of the Sudoku game facilitates the design of other games. |
Databáze: |
OpenAIRE |
Externí odkaz: |
|