Files
Yamato/Source/MyProject3/SpaceShooterGameMode.h
2025-02-17 23:24:04 +05:30

38 lines
1014 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")
TSubclassOf<class AEnemySpaceship> EnemyClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
float EnemySpawnInterval = 2.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
int32 MaxEnemies = 10;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
float MinSpawnRadius = 1000.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
float MaxSpawnRadius = 2000.0f;
private:
FTimerHandle EnemySpawnTimer;
void SpawnEnemy();
FVector GetRandomSpawnLocation();
};