feat: add basic player setup, enemy class, and movement input

Added initial player settings, including movement logic.
Created Enemy class with basic structure.
Implemented input handling for movement and camera control.
This commit is contained in:
Foxim 2025-02-13 19:44:57 +01:00
parent 594689b82b
commit 93b047dcfa
14 changed files with 73 additions and 27 deletions

View File

@ -49,7 +49,7 @@ bUseManualIPAddress=False
ManualIPAddress=
[/Script/EngineSettings.GameMapsSettings]
EditorStartupMap=/Game/Blueprints/Levels/TestMap.TestMap
EditorStartupMap=/Game/Levels/TestMap.TestMap
LocalMapOptions=
TransitionMap=None
bUseSplitscreen=True
@ -58,7 +58,7 @@ ThreePlayerSplitscreenLayout=FavorTop
FourPlayerSplitscreenLayout=Grid
bOffsetPlayerGamepadIds=False
GameInstanceClass=/Script/Engine.GameInstance
GameDefaultMap=/Game/Blueprints/Levels/TestMap.TestMap
GameDefaultMap=/Game/Levels/TestMap.TestMap
ServerDefaultMap=/Engine/Maps/Entry.Entry
GlobalDefaultGameMode=/Game/Blueprints/Game/BP_ExoGameMode.BP_ExoGameMode_C
GlobalDefaultServerGameMode=None

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,32 +3,21 @@
#include "Characters/ExoCharacterBase.h"
// Sets default values
AExoCharacterBase::AExoCharacterBase()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bCanEverTick = false;
Weapon = CreateDefaultSubobject<USkeletalMeshComponent>("Weapon");
Weapon->SetupAttachment(GetMesh(), FName("WeaponHandSocket"));
Weapon->SetCollisionEnabled(ECollisionEnabled::NoCollision);
}
// Called when the game starts or when spawned
void AExoCharacterBase::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AExoCharacterBase::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void AExoCharacterBase::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}

View File

@ -0,0 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Characters/ExoEnemy.h"

View File

@ -0,0 +1,20 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Characters/ExoPlayerCharacter.h"
#include "GameFramework/CharacterMovementComponent.h"
AExoPlayerCharacter::AExoPlayerCharacter()
{
GetCharacterMovement()->bSnapToPlaneAtStart = true;
bUseControllerRotationPitch = true;
bUseControllerRotationYaw = true;
bUseControllerRotationRoll = false;
}
void AExoPlayerCharacter::BeginPlay()
{
Super::BeginPlay();
}

View File

@ -12,18 +12,12 @@ class EXO_API AExoCharacterBase : public ACharacter
GENERATED_BODY()
public:
// Sets default values for this character's properties
AExoCharacterBase();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UPROPERTY(EditAnywhere, Category = "Combat")
TObjectPtr<USkeletalMeshComponent> Weapon;
};

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Characters/ExoCharacterBase.h"
#include "ExoEnemy.generated.h"
/**
*
*/
UCLASS()
class EXO_API AExoEnemy : public AExoCharacterBase
{
GENERATED_BODY()
};

View File

@ -0,0 +1,21 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Characters/ExoCharacterBase.h"
#include "ExoPlayerCharacter.generated.h"
UCLASS()
class EXO_API AExoPlayerCharacter : public AExoCharacterBase
{
GENERATED_BODY()
public:
AExoPlayerCharacter();
protected:
virtual void BeginPlay() override;
};