Dualroids is a two-player asteroid shooting network game inspired by the classic game Asteroids. Dualroids is available under the Artistic License.
Dualroids is written in Java and has been tested on JDK 1.3.1 and JDK 1.4. Compatibility with JDK 1.2 and 1.3 is unknown. Dualroids won't work with JDK 1.1. In order to run Dualroids, a graphical display is required.
Dualroids uses the Java2D API for graphics and that is also the main performance bottleneck. Performance mostly depends on the performance of the Java2D implementation.
The game uses the port 9999 both for the connection between the local client and the server running in the same process and between the remote client and the server, so that port needs to be accessible.
The game is started from the Dualroids.jar file either from the command line using the command "java -jar Dualroids.jar" or by double-clicking the jar file on platforms that allow jar launching by double-clicking. A dialog is brought up for entering the player name and for choosing whether the program will act as the game server or as the client only.
One player should choose to “Act as Server” and the other should “Connect to Server”. On the server side, a waiting dialog will be displayed. On the client side, a dialog for entering the server address (hostname or IP number) is displayed. The game network setup will take a few moments after the server name has been entered.
The game starts on an asteroid field where the white ship is your ship. The idea is to blow up as many asteroids as possible and to get as many points as possible in the process--without colliding with the asteroids, of course. The larger asteroids require more hits in order to explode. Points are awarded only to the player who fires the last shot that makes the asteroid explode. When there are no asteroids left, a new level starts, The number of asteroids and the velocity of the asteroids is greater on each new level. A player gets a new spare ship for every 500 points. The ships break if they collide with asteroids.
The ship is controlled with the arrow keys. The right and left arrows turn the ship and the arrow up thrusts. The space bar fires. The ship has no breaks. The ships need to be turned around in order to slow down.
The q key quits the game. The other player is informed about quitting. Quitting in the middle of a game is of course impolite.
The game ends when one player runs out of ships. A high score table is displayed in the end. (The table is stored in a file called “dualroids-scores.dat” which shouldn't be removed or altered.)
In order to start a new game, the program has to be restarted.
System.currentTimeMillis()method. On Windows 98 the value returned by
System.currentTimeMillis()is reportedly updated only 18 times per second. The problem doesn't occur on NT-based Windows systems or on Unix-like systems.
NullPointerExceptions are thrown within Apple's event implementation. In this case the game reacts to keyboar input clumsily. The problem is believed to be a bug in Apple's event implementation.