Create shooting game mode

This commit is contained in:
2025-02-15 22:15:10 +05:30
parent 536a938d55
commit 4ee95ea366
2 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "SpaceShooterGameMode.generated.h"
UCLASS()
class MYPROJECT3_API ASpaceShooterGameMode : public AGameModeBase
{
GENERATED_BODY()
public:
ASpaceShooterGameMode();
virtual void StartPlay() override;
virtual void Tick(float DeltaTime) override;
protected:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
float EnemySpawnInterval = 3.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
float SpawnRadius = 2000.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
int32 MaxEnemies = 5;
private:
FTimerHandle EnemySpawnTimer;
void SpawnEnemy();
FVector GetRandomSpawnLocation();
};