Ray Kelm

  • About
    • Home
    • News

User Login

  • Create account
  • Reset password

Projects

  • SDL_gui
  • Cyclone
  • roaddemo
  • rtChess
  • exemel
  • gp2x
  • robot

Options

Recent News

  • leJOS NXJ for Mindstorms NXT
  • Chumby at work
  • Chumby!
  • And...
  • Busy busy busy...

News Tags

  • news (46)
  • cyclone (15)
  • SDL_gui (14)
  • robot (7)
  • chumby (3)
  • lego (3)
  • exemel (2)
  • nms (1)
  • work (1)
  • dev (1)
  • robofest (1)
  • rtChess (1)
  • roaddemo (1)
  • osgi (1)

Links

  • DataSlab Hosting
  • SellMySoftwareOnline!
  • SDL
  • YAAARC
  • FIRST
  • Arduino

Client Details

The client is a single thread, which initializes the video, sets the client mode to "select server", and drops in to the main loop. The main loop processes key and mouse input, and sends it to the appropriate handler based on the client mode.

In "select server" mode, a list of known servers is displayed, along with a box to type in an IP address or hostname. The only keys active are for entering the server address. Clicking on a hostname copies it into the input buffer for the server address. Clicking on the "connect" button puts the client into "connecting" mode.

In "connecting" mode, most user input is ignored, except for clicking the cancel button, or pressing escape. Either action returns the client to "select server" mode. Once the connection is formed, and the ship list is read the client enters "ship select" mode. Note that the trigger for switching into this mode is receiving the ship data.

In "ship select' mode, the current ship type is displayed, along with the stats. The "next" and "prev" buttons allow the user to cycle through the available ships, and the "accept" button transmits the ship selection, and puts the player into "playing" mode. The trigger for switching to "playing" mode is the acknowledge packet from the server.

In "playing" mode, updates received from the server are displayed on-screen, and keypresses are mapped into actions, and transmitted to the server. Sound updates received from the server are played as soon as they are received. Pressing escape will switch to "quit confirm" mode.

in "quit confirm" mode will prompt for quit confirmation. Clicking "continue" removes the confirmation and returns to "playing" mode. Clicking "quit" closes the connection and returns the client to "select server" mode. Game display updates still occur while in "quit confirm" mode.

When the player is destroyed, a "ship destroyed" packet will be received, which will put the player into "dead" mode. From "dead" mode, pressing space or clicking the "continue" option will put the player back into "playing" mode by sending a "continue" packet, and waiting for the acknowledgement. Pressing escape or clicking the "quit" option will disconnect the player, and enter "select server" mode. Game display updates still occur while in "dead" mode.

Copyright © Ray Kelm. All rights reserved.

Valid XHTML 1.0 Strict Valid CSS!