Create shooting game mode
This commit is contained in:
32
Source/MyProject3/SpaceShooterGameMode.h
Normal file
32
Source/MyProject3/SpaceShooterGameMode.h
Normal 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();
|
||||
};
|
||||
Reference in New Issue
Block a user