Compare commits

..

3 Commits

Author SHA1 Message Date
baz f6bbc7e8f0 Add Bat sprite to EnemyCharacter 2024-08-23 02:14:20 +01:00
baz c9c1753233 Add PaperFlipbookComponent to VampireCharacter class 2024-08-23 02:14:07 +01:00
baz d6f728e376 Add Wild Grass Texture 2024-08-23 01:17:52 +01:00
17 changed files with 50 additions and 11 deletions

BIN
Content/Enemy/BP_EnemyCharacter.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Enemy/M_Test.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Levels/Level.umap (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Sprites/Bat/PF_Bat.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Sprites/Bat/T_Bat1.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Sprites/Bat/T_Bat2.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Sprites/Bat/T_Bat3.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Sprites/Bat/bat1_Sprite.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Sprites/Bat/bat2_Sprite.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Sprites/Bat/bat3_Sprite.uasset (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -38,6 +38,7 @@ void AVampireAIController::OnPossess(APawn* InPawn)
EnemyCharacter = Cast<AEnemyCharacter>(InPawn); EnemyCharacter = Cast<AEnemyCharacter>(InPawn);
check(EnemyCharacter); check(EnemyCharacter);
EnemyCharacter->bUseControllerRotationYaw = false;
EnemyCharacter->GetHealthComponent()->OnDamaged.BindUFunction(this, "OnDamaged"); EnemyCharacter->GetHealthComponent()->OnDamaged.BindUFunction(this, "OnDamaged");
EnemyCharacter->GetHealthComponent()->OnDeath.BindUFunction(this, "OnDeath"); EnemyCharacter->GetHealthComponent()->OnDeath.BindUFunction(this, "OnDeath");

View File

@ -11,6 +11,11 @@ AVampireCharacter::AVampireCharacter()
// Create Health Component // Create Health Component
HealthComponent = CreateDefaultSubobject<UHealthComponent>(TEXT("Health Component")); HealthComponent = CreateDefaultSubobject<UHealthComponent>(TEXT("Health Component"));
PaperFlipbookComponent = CreateDefaultSubobject<UPaperFlipbookComponent>(TEXT("Paper Flipbook Component"));
PaperFlipbookComponent->SetRelativeRotation(FRotator(0.0f, 90.0f,-90.0f));
PaperFlipbookComponent->SetRelativeScale3D(FVector(0.2f, 0.2f, 0.2f));
PaperFlipbookComponent->SetupAttachment(RootComponent);
} }
// Called when the game starts or when spawned // Called when the game starts or when spawned

View File

@ -5,6 +5,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "HealthComponent.h" #include "HealthComponent.h"
#include "PaperFlipbookComponent.h"
#include "VampireCharacter.generated.h" #include "VampireCharacter.generated.h"
UCLASS() UCLASS()
@ -12,11 +13,14 @@ class VAMPIRES_API AVampireCharacter : public ACharacter
{ {
GENERATED_BODY() GENERATED_BODY()
protected: public:
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UPaperFlipbookComponent* PaperFlipbookComponent;
protected:
UPROPERTY() UPROPERTY()
UHealthComponent* HealthComponent; UHealthComponent* HealthComponent;
public: public:
// Sets default values for this character's properties // Sets default values for this character's properties
AVampireCharacter(); AVampireCharacter();
@ -25,7 +29,7 @@ protected:
// Called when the game starts or when spawned // Called when the game starts or when spawned
virtual void BeginPlay() override; virtual void BeginPlay() override;
public: public:
// Called every frame // Called every frame
virtual void Tick(float DeltaTime) override; virtual void Tick(float DeltaTime) override;
@ -33,5 +37,4 @@ public:
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UHealthComponent* GetHealthComponent(); UHealthComponent* GetHealthComponent();
}; };