Initial HUD implementation and timer + game over
This commit is contained in:
@@ -44,6 +44,12 @@ public:
|
||||
virtual void StartPlay() override;
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
void IncrementKillCount();
|
||||
void RestartGame();
|
||||
int32 GetKillCount() const { return KillCount; }
|
||||
float GetRemainingTime() const { return RemainingTime; }
|
||||
bool IsGameOver() const { return bIsGameOver; }
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
TSubclassOf<class AEnemySpaceship> EnemyClass;
|
||||
@@ -78,6 +84,18 @@ protected:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning|Difficulty")
|
||||
int32 DifficultyInterval = 30;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Rules")
|
||||
float GameDuration = 30.0f; // 3 minutes default
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Game Stats")
|
||||
int32 KillCount;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Game Stats")
|
||||
float RemainingTime;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Game State")
|
||||
bool bIsGameOver;
|
||||
|
||||
private:
|
||||
FTimerHandle EnemySpawnTimer;
|
||||
FTimerHandle DifficultyTimer;
|
||||
@@ -99,4 +117,8 @@ private:
|
||||
|
||||
// New helper method to ensure minimum spawn distance
|
||||
FVector EnsureMinimumSpawnDistance(const FVector& ProposedLocation, const FVector& PlayerLocation);
|
||||
|
||||
void EndGame();
|
||||
void UpdateGameTimer();
|
||||
FTimerHandle GameTimerHandle;
|
||||
};
|
||||
Reference in New Issue
Block a user