Contra Wars: Game Input and Logic

Setup

firebullet

KbdInstall

KbdUninstall

MouseInstall

MouseUninstall

WaitForInput

movebullet

CollisionDet

startbullet

Truly global structures, variables, and constants:

Structures:

Variables:


Constants:

  • NUM_WALK_STATES ; number of animation states
  • NUM_PLAYERS equ 18 ; the maximum number of players
  • MAX_BULLETS equ 6 ; the maximum number of bullets a ; player can fire
  • NUM_TEAMS equ 3 ; the number of teams allowed in ; the game
  • TRUE EQU 1 ; for boolean logic
  • FALSE EQU 0
  • MAP_WIDTH equ 50 ; number of tiles in the ; x-direction in world map
  • MAP_HEIGHT equ 32 ; number of tiles in the ; y-direction in world map
  • WALK_STATE_STILL equ 0 ; state when standing still
  • WALK_STATE_LEFT equ 1 ; state when walking on left foot
  • WALK_STATE_RIGHT equ2 ; state when walking on right foot
  • SIZEPLAYERSTRUCT equ 58
  • SIZEBULLETSTRUCT equ 8
  • BULLET_WAIT equ 20 ; delay after which a player can fire a bullet again
  • BULLET_RANGE equ 40 ; count at which bullet disappears
  • WALK_TIME equ 23 ; determines time before next animation

    MACROS:

  • DOSEXIT ; macro from macros.inc
  • CheckCol ; checks for collisions given the sizes and ; offsets in game coordinates of two bounding boxes
  • MapLookUp ; given game coordinates, figures out tile ; coordinates