|
|
|
@ -26,6 +26,7 @@ void Enemy::Hurt(int damage) { |
|
|
|
|
t.col[2] = BLACK; |
|
|
|
|
} |
|
|
|
|
health-=damage; |
|
|
|
|
blinkingAmt = 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Enemy::isDead() { |
|
|
|
@ -119,7 +120,6 @@ void Enemy::OnDeathEvent() { |
|
|
|
|
if (game->enemyData[id].powerupDrop != PowerupType::NONE) { |
|
|
|
|
game->SpawnPowerup(game->enemyData[id].powerupDrop, pos); |
|
|
|
|
} |
|
|
|
|
blinkingAmt = 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FaceBall::InitializeEnemyData() { |
|
|
|
@ -1762,7 +1762,9 @@ void FaceBall::RenderHud(float fElapsedTime) { |
|
|
|
|
FillRectDecal({ 0,0 }, { float(ScreenWidth()),float(ScreenHeight()) }); |
|
|
|
|
std::string topText = enemyData[lastHitBy].name + " SAYS"; |
|
|
|
|
std::string bottomText = "HAVE A NICE DAY !"; |
|
|
|
|
Display3DKillerModel(); |
|
|
|
|
if (!enemyData[lastHitBy].blinking||std::sinf(30*gameTimer)>0.4f) { |
|
|
|
|
Display3DKillerModel(); |
|
|
|
|
} |
|
|
|
|
DrawStringDecal({ (float)(ScreenWidth() / 2 - GetTextSize(topText).x / 2 * 3),140.f }, topText, { 96,96,255 }, { 3,6 }); |
|
|
|
|
DrawStringDecal({ float(ScreenWidth() / 2 - GetTextSize(bottomText).x / 2 * 3),float(ScreenHeight() - 140.f) }, bottomText, { 96,96,255 }, { 3,6 }); |
|
|
|
|
} |
|
|
|
@ -1784,7 +1786,7 @@ void FaceBall::RenderHud(float fElapsedTime) { |
|
|
|
|
if (hp > 0) { |
|
|
|
|
DrawStringDecal(vf2d{ 112 + hudOffset+32,4+18 }+hudAdjustment, "Triangles: " + std::to_string(triRenderCount), BLACK, { 2,4 }); |
|
|
|
|
std::string hudText = "Tags Left: " + std::to_string(tagsRemaining) + " Lives: " + std::to_string(lives); |
|
|
|
|
DrawStringPropDecal(vf2d{ hudOffset + (float)(ScreenWidth() / 2 - GetTextSizeProp(hudText).x * 3 / 2)+32,(float)(ScreenHeight() - 2 - GetTextSizeProp(hudText).y * 5)+18 } + hudAdjustment, hudText, WHITE, { 3,5 }); |
|
|
|
|
DrawStringPropDecal(vf2d{ hudOffset + (float)(ScreenWidth() / 2 - GetTextSizeProp(hudText).x * 3 / 2)+32,(float)(ScreenHeight() - 2 - GetTextSizeProp(hudText).y * 5)+18 } + hudAdjustment, hudText, VERY_DARK_GREY, { 3,5 }); |
|
|
|
|
for (int x = -1; x <= 1; x++) { |
|
|
|
|
for (int y = -1; y <= 1; y++) { |
|
|
|
|
if (x != 0 && y != 0) { |
|
|
|
@ -2053,6 +2055,7 @@ void FaceBall::RunEnemyAI(Enemy& e,float fElapsedTime,int myIndex) { |
|
|
|
|
|
|
|
|
|
bool FaceBall::OnUserUpdate(float fElapsedTime) |
|
|
|
|
{ |
|
|
|
|
fElapsedTime = std::min(0.1667f, fElapsedTime); |
|
|
|
|
gameTimer += fElapsedTime; |
|
|
|
|
switch (mode) { |
|
|
|
|
case GAME: { |
|
|
|
|