This is an overview of the most important application implementation issues.
Starpoint Arena consists of three main packages:
Any main application must implement interface StarpointContext, that is used for interaction between the core game and the surrounding application.
- StarpointArenaNG contains all components of the platform-unspecific 2D-game. Some aspects of 3D-gaming are prepared (menu structures,
player view directions, 3D-items) but not implemented when it comes to 3D-display.
- StarpointDesktop contains all components for the javax.swing-based main application.
- Starpoint3D contains all components for the JAVA3D- and javax.swing-based main application that requires an installed JAVA 3D.
The main application control flow is described in this diagram:
In 2D gaming, the context application only requires to provide platform specific implementations for:
Since Starpoint3D requires the JAVA3D-API, it is implemented as seperate application (allowing 2D gaming as well). It provides an own PainterFactory for
3D-specific painters, special mouse handling for changing camera perspective and the complete 3D-scene creation and -modification based on the GameState-updates.
- GraphicContext for 2D graphic display - StarpointDesktop implements this by delegating to java.awt.Canvas-methods.
- SoundContext for platform specific sound playback - StarpointDesktop implements this by using javax.sound
- Vibration - not used in StarpointDesktop game
- Mouse- and Keyboard event handling - StarpointDesktop handles java.awt-Events and passes them to the StarpointController
As shown in the initial diagram, StarpointArenaNG is completely capable of doing all 2D-painting necessary for the standard game.
Depending on the GameMode (Menu, Editor, Game etc.), a PainterSet consisting of layered painters is used for painting to the GraphicContext (provided by the main application).
During game, these layers are as follows:
The Painter2DArena-class implements the logic for displaying the field and all game elements. Its paint sequence is as follows: