Files
Yamato/Source/MyProject3/SpaceShooterGameMode.h
2025-02-15 22:15:10 +05:30

32 lines
779 B
C++

#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();
};