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

@@ -0,0 +1,45 @@
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/HUD.h"
#include "SpaceShooterHUD.generated.h"
UCLASS()
class MYPROJECT3_API ASpaceShooterHUD : public AHUD
{
GENERATED_BODY()
public:
ASpaceShooterHUD();
virtual void DrawHUD() override;
protected:
UPROPERTY()
UFont* TextFont;
// Bar configuration
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
float BarWidth = 200.0f;
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
float BarHeight = 20.0f;
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
float BarPadding = 10.0f;
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
FLinearColor HealthBarColor = FLinearColor(1.0f, 0.0f, 0.0f, 1.0f); // Red
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
FLinearColor ShieldBarColor = FLinearColor(0.0f, 0.5f, 1.0f, 1.0f); // Light Blue
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
FLinearColor BackgroundBarColor = FLinearColor(0.0f, 0.0f, 0.0f, 0.5f); // Semi-transparent black
private:
void DrawGameplayHUD();
void DrawGameOverScreen();
void DrawStatusBars();
class ASpaceShooterGameMode* GetGameMode() const;
class ASpaceshipPawn* GetPlayerPawn() const;
};