Create blueprints for classes and add meshes and textures

This commit is contained in:
2025-02-16 14:02:01 +05:30
parent 32365c408c
commit 6fb1b648ec
16 changed files with 59 additions and 5 deletions

View File

@@ -5,10 +5,21 @@
ASpaceShooterGameMode::ASpaceShooterGameMode()
{
// Set default pawn class using the inherited DefaultPawnClass
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/Blueprints/BP_SpaceshipPawn"));
if (PlayerPawnBPClass.Class != nullptr)
{
DefaultPawnClass = PlayerPawnBPClass.Class;
}
// Enable Tick()
PrimaryActorTick.bCanEverTick = true;
// Set default pawn class to our spaceship
DefaultPawnClass = ASpaceshipPawn::StaticClass();
// Debug message
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("GameMode Constructor"));
}
}
void ASpaceShooterGameMode::StartPlay()
@@ -18,6 +29,12 @@ void ASpaceShooterGameMode::StartPlay()
// Start spawning enemies
GetWorldTimerManager().SetTimer(EnemySpawnTimer, this, &ASpaceShooterGameMode::SpawnEnemy,
EnemySpawnInterval, true);
// Debug message
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("GameMode StartPlay"));
}
}
void ASpaceShooterGameMode::Tick(float DeltaTime)