?? bomberbonus.c
字號:
//Clear the bonuses
void ClearBonus ()
{
int x, y;
for (y = 0; y < 17; y++) for (x = 0; x < 17; x++)
BonusGrid [x][y] = 0;
}
//Draw all bonuses
void DrawBonus ()
{
int x, y;
for (y = 0; y < 17; y++) for (x = 0; x < 17; x++)
if (BonusGrid [x][y]) DrawBlock (x, y, BonusGrid [x][y] + (Frame & 2), 4);
}
//Check whether a player receives a bonus
void CheckBonus ()
{
int p, x, y;
for (p = 0; p < Players; p++) {
//Calculate coordinates
x = PlayerX [p] >> 4;
y = PlayerY [p] >> 4;
//If there is a bonus
if (BonusGrid [x][y]) {
//Take appropriate action
if (BonusGrid [x][y] == 1) if (MaxRange [p] < 15) MaxRange [p]++;
if (BonusGrid [x][y] == 2) if (MaxBombs [p] < 8) MaxBombs [p]++;
//Play sound
PlaySound ((LPCSTR)Bonus, NULL, SND_ASYNC | SND_MEMORY);
//Remove the bonus
BonusGrid [x][y] = 0;
DrawBlock (x, y, 0, 0);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -