Initial HUD implementation and timer + game over

This commit is contained in:
2025-04-16 12:54:22 +05:30
parent c292da805d
commit f732cdef59
8 changed files with 298 additions and 8 deletions

View File

@@ -6,8 +6,7 @@
#include "DrawDebugHelpers.h"
#include "Math/UnrealMathUtility.h"
#include "EnemyProjectile.h"
// Include SpaceshipPawn to access player-specific functionality
#include "SpaceShooterGameMode.h"
#include "SpaceshipPawn.h"
AEnemySpaceship::AEnemySpaceship()
@@ -559,6 +558,11 @@ void AEnemySpaceship::Die()
GetActorLocation()
);
if (ASpaceShooterGameMode* GameMode = Cast<ASpaceShooterGameMode>(UGameplayStatics::GetGameMode(GetWorld())))
{
GameMode->IncrementKillCount();
}
// Destroy the enemy
Destroy();
}