home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / demos / mfighter / build / hfighter.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-12  |  1020 b   |  48 lines

  1. #include <fastgraf.h>
  2. #include "hfighter.h"
  3. #include "game.h"
  4. #include "match.h"
  5.  
  6.  
  7. void HumanFighter::configure(int s)
  8.   {
  9.   request_hotkey_cue(PUNCHKEY,(callback)&HumanFighter::on_punch);
  10.   request_hotkey_cue(KICKKEY,(callback)&HumanFighter::on_kick);
  11.   request_hotkey_cue(LEFTKEY,(callback)&HumanFighter::on_left);
  12.   request_hotkey_cue(RIGHTKEY,(callback)&HumanFighter::on_right);
  13.   request_hotkey_cue(BLOCKKEY,(callback)&HumanFighter::on_block);
  14.  
  15.   set_side(s);
  16.   Fighter::initialize();
  17.   }
  18.  
  19. void HumanFighter::on_punch(int)
  20.   {
  21.   if (punch() && usepacks)
  22.     post_netpack(PUNCHKEY);
  23.   }
  24.  
  25. void HumanFighter::on_kick(int)
  26.   {
  27.   if (kick() && usepacks)
  28.     post_netpack(KICKKEY);
  29.   }
  30.  
  31. void HumanFighter::on_left(int)
  32.   {
  33.   if (left() && usepacks)
  34.     post_netpack(LEFTKEY);
  35.   }
  36.  
  37. void HumanFighter::on_right(int)
  38.   {
  39.   if (right() && usepacks)
  40.     post_netpack(RIGHTKEY);
  41.   }
  42.  
  43. void HumanFighter::on_block(int)
  44.   {
  45.   if (block() && usepacks)
  46.     post_netpack(BLOCKKEY);
  47.   }
  48.