Add deleted sphere model back
This commit is contained in:
@@ -4,6 +4,35 @@
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "SpaceShooterGameMode.generated.h"
|
||||
|
||||
// Enum for different spawn patterns
|
||||
UENUM(BlueprintType)
|
||||
enum class ESpawnPattern : uint8
|
||||
{
|
||||
Random, // Randomly at screen edges
|
||||
Wave, // Groups of enemies from one direction
|
||||
Formation, // Specific formations (V-shape, line, etc.)
|
||||
Flanking // Enemies from multiple sides simultaneously
|
||||
};
|
||||
|
||||
// Struct to define a spawn point/zone
|
||||
USTRUCT(BlueprintType)
|
||||
struct FSpawnZone
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FVector Location;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
float Radius = 100.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
float SpawnWeight = 1.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bActive = true;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class MYPROJECT3_API ASpaceShooterGameMode : public AGameModeBase
|
||||
{
|
||||
@@ -20,19 +49,48 @@ protected:
|
||||
TSubclassOf<class AEnemySpaceship> EnemyClass;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
float EnemySpawnInterval = 2.0f;
|
||||
float BaseEnemySpawnInterval = 2.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
int32 MaxEnemies = 10;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
float MinSpawnRadius = 1000.0f;
|
||||
float ScreenSpawnMargin = 100.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
float MaxSpawnRadius = 2000.0f;
|
||||
TArray<FSpawnZone> SpawnZones;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
TArray<ESpawnPattern> SpawnPatterns;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
int32 WaveSize = 3;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
|
||||
float FormationSpacing = 150.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning|Difficulty")
|
||||
float DifficultyScaling = 0.95f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning|Difficulty")
|
||||
int32 DifficultyInterval = 30;
|
||||
|
||||
private:
|
||||
FTimerHandle EnemySpawnTimer;
|
||||
FTimerHandle DifficultyTimer;
|
||||
float CurrentSpawnInterval;
|
||||
ESpawnPattern CurrentPattern;
|
||||
int32 CurrentWaveCount;
|
||||
float GameTime;
|
||||
|
||||
void SpawnEnemy();
|
||||
FVector GetRandomSpawnLocation();
|
||||
void SpawnEnemyWave();
|
||||
void SpawnEnemyFormation();
|
||||
void SpawnEnemyFlanking();
|
||||
FVector GetScreenEdgeSpawnLocation();
|
||||
FVector GetSpawnZoneLocation();
|
||||
void UpdateDifficulty();
|
||||
FVector GetPlayerLocation();
|
||||
TArray<FVector2D> GetScreenBounds();
|
||||
void RotateTowardsPlayer(AEnemySpaceship* Enemy, const FVector& PlayerLocation);
|
||||
};
|
||||
Reference in New Issue
Block a user