Skip to content

Commit

Permalink
Added new color for boss health (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaygarcia authored Nov 5, 2020
1 parent bb30636 commit 71c05c2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/GResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ const TUint16 IMG_GREEN_BOTTLE3 = 126; // 75% full
const TUint16 IMG_GREEN_BOTTLE4 = 127; // 100% full

//// RESERVED COLORS
const TUint8 COLOR_ENEMY_HEALTH = 239; // for hit/flash animations, etc.
const TUint8 COLOR_WHITE = 240; // for hit/flash animations, etc.
const TUint8 COLOR_SHADOW = 241;
const TUint8 COLOR_SHMOO_RED = 242;
Expand Down
4 changes: 2 additions & 2 deletions src/GameState/GAnchorSprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ TBool GAnchorSprite::Render(BViewPort *aViewPort) {
// render sprite border if sprite is visible
if (TestFlags(SFLAG_RENDER)) {
bm.DrawRect(aViewPort, mRect, COLOR_WHITE);
bm.DrawFastHLine(aViewPort, mRect.x1 - 5, mRect.y2, 10, COLOR_HEALTH);
bm.DrawFastVLine(aViewPort, mRect.x1, mRect.y2 - 5, 10, COLOR_HEALTH);
bm.DrawFastHLine(aViewPort, mRect.x1 - 5, mRect.y2, 10, COLOR_ENEMY_HEALTH);
bm.DrawFastVLine(aViewPort, mRect.x1, mRect.y2 - 5, 10, COLOR_ENEMY_HEALTH);
// bm.DrawString(aViewPort, Name(), gFont8x8, mRect.x1 + 1, mRect.y2 + 1, COLOR_TEXT, COLOR_TEXT_TRANSPARENT, -1);
switch (mDirection) {
case DIRECTION_UP:
Expand Down
1 change: 1 addition & 0 deletions src/GameState/GGameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ void GGameState::PreRender() {
}
}
gDisplay.SetColor(COLOR_WHITE, 255, 255, 255);
gDisplay.SetColor(COLOR_ENEMY_HEALTH, 0xff, 0x59, 0x43);
}

/*******************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions src/GameState/GHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void GHud::Render() {

if (healthPct < .10f && frame % 30 == 0) {
darkHealth = ! darkHealth;
if (darkHealth) {
if (darkHealth && gGame->GetState() == GAME_STATE_GAME) {
gSoundPlayer.TriggerSfx(SFX_PLAYER_LOW_HEALTH_WAV, 2);
}

Expand Down Expand Up @@ -159,7 +159,7 @@ void GHud::Render() {
gDisplay.renderBitmap->FillRect(gViewPort, 20, h - 16, 21 + STAT_WIDTH, h - 12, COLOR_TEXT);
if (boss->mHitPoints > 0) {
gDisplay.renderBitmap->FillRect(gViewPort, 20, h - 16, 21 + boss->mHitPoints * STAT_WIDTH / boss->mMaxHitPoints,
h - 12, COLOR_HEALTH2);
h - 12, COLOR_ENEMY_HEALTH);
}
}
}

0 comments on commit 71c05c2

Please sign in to comment.