Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "CoreMinimal.h"
- #include "GameFramework/GameStateBase.h"
- #include "SGameState.h"
- #include "SGameMode.generated.h"
- enum class EWaveState : uint8;
- /**
- *
- */
- UCLASS()
- class COOPGAME_API ASGameState : public AGameStateBase
- {
- GENERATED_BODY()
- protected:
- FTimerHandle TimerHandle_BotSpawner;
- FTimerHandle TimerHandle_NextWaveStart;
- // Bots to spawn in current wave
- int32 NrOfBotsToSpawn;
- int32 WaveCount;
- UPROPERTY(EditDefaultsOnly, Category = "GameMode")
- float TimeBetweenWaves;
- protected:
- // Hook for BP to spawn a single bot
- UFUNCTION(BlueprintImplementableEvent, Category = "GameMode")
- void SpawnNewBot();
- void SpawnBotTimerElapsed();
- // Start Spawning bots
- void StartWave();
- // Stop spawning Bots
- void EndWave();
- // Set timer for next bot wave
- void PrepareForNextWave();
- void CheckWaveState();
- void CheckAnyPlayerAlive();
- void GameOver();
- void SetWaveState(EWaveState NewState);
- public:
- ASGameMode();
- virtual void StartPlay() override;
- virtual void Tick(float DeltaSeconds) override;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement