Create blueprints for classes and add meshes and textures
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user