⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bomberwinlose.c

📁 一个炸弹人游戏的源代码(win32 application)
💻 C
字号:
int LimitReached = 0;

//Initialize the menu
void InitWinLose ()
{
  int   p, w;
  int   LivingPlayers = Players;

  //Stop MIDI sound
  StopMidi ();

  //Count amount of living players
  for (p = 0; p < Players; p++)
    if (PlayerDead [p]) LivingPlayers--;

  //Reward player
  if (LivingPlayers < 2) {
    for (p = 0; p < Players; p++) {
      if (!PlayerDead [p]) {
        LimitReached = ++PlayerWon [p];
      }
    }
  }

  //Draw to front buffer
  TargetData = MainBitmapData;

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

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

  //Display players
  for (p = 0; p < Players; p++) {
    if (PlayerDead [p])
      Blit (60, 90 + p * 32, 232, p * 24, 16, 24);
    else
      Blit (60, 90 + p * 32, 208, p * 24, 16, 24);
    for (w = 1; w <= PlayerWon [p]; w++)
      Blit (92 + w * 24, 90 + p * 32, 160, 48, 16, 24);
  }
}

//Do the win/lose stuff
void WinLoseLoop ()
{
  int Key = getch ();

  //Only enter will suffice
  if (Key == VK_RETURN) {
    if (LimitReached == 5) {
      State = IN_MENU;
      InitMenu ();
    } else {
      State = IN_GAME;
      NewGame ();
    }
  }
}

⌨️ 快捷键说明

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