Main Page   Data Structures   File List   Globals  

input.h File Reference

This header file defines the screen and board layout for Stratego. More...

Go to the source code of this file.

Defines

#define TRUE   1
#define FALSE   0
#define MOUSE_DOWN   0
 True when the mouse button is pressed down. More...

#define MOUSE_UP   1
 True when the mouse button not pressed. More...

#define SCREEN_WIDTH   240
 The width of the screen in pixels. More...

#define SCREEN_HEIGHT   320
 The height of the screen in pixels. More...

#define BOARD_WIDTH   240
 The width of the main game board in pixels. More...

#define BOARD_HEIGHT   240
 The height of the main game board in pixels. More...

#define BOARD_X_SQUARES   10
 The number of squares on the game board horizontally. More...

#define BOARD_Y_SQUARES   10
 The number of squares on the game board vertically. More...

#define BOARD_PLACE_BOUNDARY   80
 The boundary between the main board and the placing panel. More...

#define PLACE_WIDTH   240
 The width of the placing panel in pixels. More...

#define PLACE_HEIGHT   60
 The height of the placing panel in pixels. More...

#define PLACE_X_SQUARES   6
 The number of squares on the placing panel horizontally. More...

#define PLACE_Y_SQUARES   2
 The number of squares on the placing panel vertically. More...

#define PLACE_BUTTONS_BOUNDARY   20
 The boundary between the placing panel and the button area. More...

#define BUTTONS_WIDTH   240
 The width of each button. More...

#define NO_BUTTONS_X   2
 The number of buttons in the button area of the screen. More...


Detailed Description

This header file defines the screen and board layout for Stratego.

The screen is split into a main board area, a placing panel and a button area. The dimentions and position of each area is defined below along with the number of squares or buttons on each section on the screen.

See the screen layout page for more details including pixel and square numbering convensions.

By using a header file to define the screen and board layout, I have made the Input module flexible and reusable, as it can support a different board game just by changing the values in this file.

Definition in file input.h.


Define Documentation

#define BOARD_HEIGHT   240
 

The height of the main game board in pixels.

Definition at line 32 of file input.h.

Referenced by process_move, and process_placing.

#define BOARD_PLACE_BOUNDARY   80
 

The boundary between the main board and the placing panel.

BOARD_PLACE_BOUNDARY is the y screen coordinate (in pixels) of the boundary between the main board and the placing panel. To be exact, this is the y value of the first pixel in the main board area.

Definition at line 43 of file input.h.

Referenced by poin_entry_Run, process_move, and process_placing.

#define BOARD_WIDTH   240
 

The width of the main game board in pixels.

Definition at line 30 of file input.h.

Referenced by process_move, and process_placing.

#define BOARD_X_SQUARES   10
 

The number of squares on the game board horizontally.

Definition at line 34 of file input.h.

Referenced by process_move, and process_placing.

#define BOARD_Y_SQUARES   10
 

The number of squares on the game board vertically.

Definition at line 36 of file input.h.

Referenced by process_move, and process_placing.

#define BUTTONS_WIDTH   240
 

The width of each button.

Definition at line 62 of file input.h.

Referenced by process_button.

#define FALSE   0
 

Definition at line 18 of file input.h.

#define MOUSE_DOWN   0
 

True when the mouse button is pressed down.

Definition at line 20 of file input.h.

Referenced by poin_entry_Run.

#define MOUSE_UP   1
 

True when the mouse button not pressed.

Definition at line 22 of file input.h.

#define NO_BUTTONS_X   2
 

The number of buttons in the button area of the screen.

Definition at line 64 of file input.h.

Referenced by process_button.

#define PLACE_BUTTONS_BOUNDARY   20
 

The boundary between the placing panel and the button area.

PLACE_BUTTONS_BOUNDARY is the y screen coordinate (in pixels) of the boundary between the placing panel and the button area. To be exact, this is the y value of the first pixel in the placing panel area.

Definition at line 59 of file input.h.

Referenced by poin_entry_Run.

#define PLACE_HEIGHT   60
 

The height of the placing panel in pixels.

Definition at line 48 of file input.h.

Referenced by process_placing.

#define PLACE_WIDTH   240
 

The width of the placing panel in pixels.

Definition at line 46 of file input.h.

Referenced by process_placing.

#define PLACE_X_SQUARES   6
 

The number of squares on the placing panel horizontally.

Definition at line 50 of file input.h.

Referenced by process_placing.

#define PLACE_Y_SQUARES   2
 

The number of squares on the placing panel vertically.

Definition at line 52 of file input.h.

Referenced by process_placing.

#define SCREEN_HEIGHT   320
 

The height of the screen in pixels.

Definition at line 27 of file input.h.

Referenced by poin_entry_Run.

#define SCREEN_WIDTH   240
 

The width of the screen in pixels.

Definition at line 25 of file input.h.

Referenced by poin_entry_Run.

#define TRUE   1
 

Definition at line 17 of file input.h.


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