bombersetup.c

来自「一个炸弹人游戏的源代码(win32 application)」· C语言 代码 · 共 58 行

C
58
字号
int     WhichPlayer, WhichKey;

//Initialize the menu
void InitSetup ()
{
  //Draw to front buffer
  TargetData = MainBitmapData;

  //Clear buffer
  memset ((char *)TargetData, 0, 221952);

  //Display title
  Blit (35, 32, 0, 80, 203, 29);

  FlushKeys ();
  WhichPlayer = 0;
  WhichKey = 0;
}

//Display the number of players
void SetupDisplay ()
{
  //Display "player"
  Blit (96, 100, 64, 108, 48, 15);

  //Display number
  Blit (160, 100, WhichPlayer * 8, 168, 8, 15);

  //Display directive
  Blit (60, 132, 64, 123 + WhichKey * 15, 152, 15);
}

//Do the menu stuff
void SetupLoop ()
{
  int Key = getch ();

  //Display instructions
  SetupDisplay ();

  //Add a new key
  if (Key != -1) {
    ChosenKeys [WhichPlayer * 5 + WhichKey] = Key;
    //Move on to next one
    WhichKey++;
    if (WhichKey == 5) {
      WhichKey = 0;
      WhichPlayer++;
    }
  }

  //Exit if we're here
  if (WhichPlayer == 3) {
    SaveKeys ();
    State = IN_MENU;
    InitMenu ();
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?