VCC Behaviour

Here is the VCC behaviour for the input module. Clicking on a block will take you to the code documentation for that block. The datatypes of the messages that pass between blocks are shown in purple. Clicking on a datatype will take you to its definition.

receive_input block process_input block output_move block ouput_button block mouse_click datatype mouse_drag datatype temp_move datatype move datatype button datatype

Block Listing

  1. receive_input - Converts mouse clicks into mouse drags.
  2. process_input - Converts mouse_drag messages into game moves or button presses.
  3. output_move - Outputs a move message to the Core module.
  4. output_button - Outputs a button message to the Core module.

Description

When the VCC simulation first starts, a player number arrives at the player external port from the lobby module. This is stored by the output_move and output_button blocks. In addition, the output_button block outputs a button message to the game core so that it also knows the player number.

Once the game has started, a mouse_click message arrives at the in external port each time the user presses or releases the mouse button. receive_input waits until it has received an up and down mouse_click message and then sends a mouse_drag message to process_input.

process_input decides what the user was trying to do, and sends a message to output_move or output_button, as appropriate. Finally output_move or output_button constructs a move or button message and sends it to the core module.

Home


Copyright © 2002 Andrew Bates
Last Updated 03/04/02