40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Actor.h"
|
|
#include "EnemySpaceship.generated.h"
|
|
|
|
UCLASS()
|
|
class MYPROJECT3_API AEnemySpaceship : public AActor
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
AEnemySpaceship();
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
|
UStaticMeshComponent* EnemyMesh;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
|
|
float MovementSpeed = 300.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Combat")
|
|
float MaxHealth = 100.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Combat")
|
|
float CurrentHealth = 100.0f;
|
|
|
|
public:
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
// Override TakeDamage to handle damage taken
|
|
virtual float TakeDamage(float DamageAmount, struct FDamageEvent const& DamageEvent,
|
|
class AController* EventInstigator, AActor* DamageCauser) override;
|
|
|
|
private:
|
|
AActor* PlayerPawn;
|
|
void Die();
|
|
}; |