diff --git a/Config/DefaultEditorPerProjectUserSettings.ini b/Config/DefaultEditorPerProjectUserSettings.ini new file mode 100644 index 0000000..93b497c --- /dev/null +++ b/Config/DefaultEditorPerProjectUserSettings.ini @@ -0,0 +1,33 @@ +[/Script/UnrealEd.EditorStyleSettings] +bEnableUserEditorLayoutManagement=True +ColorVisionDeficiencyPreviewType=NormalVision +ColorVisionDeficiencySeverity=3 +bColorVisionDeficiencyCorrection=False +bColorVisionDeficiencyCorrectionPreviewWithDeficiency=False +SelectionColor=(R=0.828000,G=0.364000,B=0.003000,A=1.000000) +AdditionalSelectionColors[0]=(R=0.019382,G=0.496933,B=1.000000,A=1.000000) +AdditionalSelectionColors[1]=(R=0.356400,G=0.040915,B=0.520996,A=1.000000) +AdditionalSelectionColors[2]=(R=1.000000,G=0.168269,B=0.332452,A=1.000000) +AdditionalSelectionColors[3]=(R=1.000000,G=0.051269,B=0.051269,A=1.000000) +AdditionalSelectionColors[4]=(R=1.000000,G=0.715693,B=0.010330,A=1.000000) +AdditionalSelectionColors[5]=(R=0.258183,G=0.539479,B=0.068478,A=1.000000) +bEnableEditorWindowBackgroundColor=False +EditorWindowBackgroundColor=(R=1.000000,G=1.000000,B=1.000000,A=1.000000) +bUseSmallToolBarIcons=False +bUseGrid=True +RegularColor=(R=0.035000,G=0.035000,B=0.035000,A=1.000000) +RuleColor=(R=0.008000,G=0.008000,B=0.008000,A=1.000000) +CenterColor=(R=0.000000,G=0.000000,B=0.000000,A=1.000000) +GridSnapSize=16 +GraphBackgroundBrush=(bIsDynamicallyLoaded=False,DrawAs=Image,Tiling=NoTile,Mirroring=NoMirror,ImageType=NoImage,ImageSize=(X=32.000000,Y=32.000000),Margin=(Left=0.000000,Top=0.000000,Right=0.000000,Bottom=0.000000),TintColor=(SpecifiedColor=(R=1.000000,G=1.000000,B=1.000000,A=1.000000),ColorUseRule=UseColor_Specified),OutlineSettings=(CornerRadii=(X=0.000000,Y=0.000000,Z=0.000000,W=1.000000),Color=(SpecifiedColor=(R=0.000000,G=0.000000,B=0.000000,A=0.000000),ColorUseRule=UseColor_Specified),Width=0.000000,RoundingType=HalfHeightRadius,bUseBrushTransparency=False),ResourceObject=None,ResourceName="",UVRegion=(Min=(X=0.000000,Y=0.000000),Max=(X=0.000000,Y=0.000000),bIsValid=False)) +bShowFriendlyNames=True +bShowNativeComponentNames=True +bExpandConfigurationMenus=False +bShowProjectMenus=True +bShowLaunchMenus=True +bShowAllAdvancedDetails=False +bShowHiddenPropertiesWhilePlaying=False +AssetEditorOpenLocation=MainWindow +bEnableColorizedEditorTabs=True +CurrentAppliedTheme=134380265FBB4A9CA00A1DC9770217B8 + diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 8ddeec0..f08eb52 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -50,5 +50,16 @@ ManualIPAddress= [/Script/EngineSettings.GameMapsSettings] EditorStartupMap=/Game/Blueprints/Levels/TestMap.TestMap +LocalMapOptions= +TransitionMap=None +bUseSplitscreen=True +TwoPlayerSplitscreenLayout=Horizontal +ThreePlayerSplitscreenLayout=FavorTop +FourPlayerSplitscreenLayout=Grid +bOffsetPlayerGamepadIds=False +GameInstanceClass=/Script/Engine.GameInstance GameDefaultMap=/Game/Blueprints/Levels/TestMap.TestMap +ServerDefaultMap=/Engine/Maps/Entry.Entry +GlobalDefaultGameMode=/Game/Blueprints/Game/BP_ExoGameMode.BP_ExoGameMode_C +GlobalDefaultServerGameMode=None diff --git a/Content/Blueprints/Game/BP_ExoGameMode.uasset b/Content/Blueprints/Game/BP_ExoGameMode.uasset new file mode 100644 index 0000000..f881e0d Binary files /dev/null and b/Content/Blueprints/Game/BP_ExoGameMode.uasset differ diff --git a/Content/Blueprints/Player/BP_ExoPlayerController.uasset b/Content/Blueprints/Player/BP_ExoPlayerController.uasset new file mode 100644 index 0000000..8ff1a75 Binary files /dev/null and b/Content/Blueprints/Player/BP_ExoPlayerController.uasset differ diff --git a/Content/Blueprints/Levels/TestMap.umap b/Content/Levels/TestMap.umap similarity index 81% rename from Content/Blueprints/Levels/TestMap.umap rename to Content/Levels/TestMap.umap index 0b8a1fc..a57ab35 100644 Binary files a/Content/Blueprints/Levels/TestMap.umap and b/Content/Levels/TestMap.umap differ diff --git a/Exo.uproject b/Exo.uproject index 9bd669e..b28ec77 100644 --- a/Exo.uproject +++ b/Exo.uproject @@ -7,7 +7,10 @@ { "Name": "Exo", "Type": "Runtime", - "LoadingPhase": "Default" + "LoadingPhase": "Default", + "AdditionalDependencies": [ + "Engine" + ] } ], "Plugins": [ diff --git a/Source/Exo/Exo.Build.cs b/Source/Exo/Exo.Build.cs index e21588e..abd0ad1 100644 --- a/Source/Exo/Exo.Build.cs +++ b/Source/Exo/Exo.Build.cs @@ -8,7 +8,7 @@ public class Exo : ModuleRules { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput"}); PrivateDependencyModuleNames.AddRange(new string[] { }); diff --git a/Source/Exo/Private/Characters/ExoCharacterBase.cpp b/Source/Exo/Private/Characters/ExoCharacterBase.cpp new file mode 100644 index 0000000..eb7bb80 --- /dev/null +++ b/Source/Exo/Private/Characters/ExoCharacterBase.cpp @@ -0,0 +1,34 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#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; + +} + +// 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); + +} + diff --git a/Source/Exo/Private/Game/ExoGameMode.cpp b/Source/Exo/Private/Game/ExoGameMode.cpp new file mode 100644 index 0000000..c4e7891 --- /dev/null +++ b/Source/Exo/Private/Game/ExoGameMode.cpp @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Game/ExoGameMode.h" + diff --git a/Source/Exo/Private/Player/ExoPlayerController.cpp b/Source/Exo/Private/Player/ExoPlayerController.cpp new file mode 100644 index 0000000..e8a157a --- /dev/null +++ b/Source/Exo/Private/Player/ExoPlayerController.cpp @@ -0,0 +1,66 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Player/ExoPlayerController.h" +#include "EnhancedInputComponent.h" +#include "EnhancedInputSubsystems.h" +#include "GameFramework/Character.h" + +AExoPlayerController::AExoPlayerController() +{ + PrimaryActorTick.bCanEverTick = true; +} + +void AExoPlayerController::BeginPlay() +{ + Super::BeginPlay(); + check(InputContext); + + UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem(GetLocalPlayer()); + + if (Subsystem) + { + Subsystem->AddMappingContext(InputContext, 0); + } + + PlayerCharacter = GetPawn(); +} + +void AExoPlayerController::PlayerTick(float DeltaTime) +{ + Super::PlayerTick(DeltaTime); +} + +void AExoPlayerController::SetupInputComponent() +{ + Super::SetupInputComponent(); + + UEnhancedInputComponent* EnhancedInputComponent = CastChecked(InputComponent); + + EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AExoPlayerController::Move); + EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AExoPlayerController::Look); +} + +void AExoPlayerController::Move(const FInputActionValue& InputActionValue) +{ + const FVector2D InputAxisVector = InputActionValue.Get(); + const FRotator Rotation = GetControlRotation(); + const FRotator YawRotation(0.f, Rotation.Yaw, 0.f); + + const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X); + const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y); + + if (PlayerCharacter) + { + PlayerCharacter->AddMovementInput(ForwardDirection, InputAxisVector.X); + PlayerCharacter->AddMovementInput(RightDirection, InputAxisVector.Y); + } +} + +void AExoPlayerController::Look(const FInputActionValue& InputActionValue) +{ + FVector2D InputAxisVector = InputActionValue.Get(); + + AddYawInput(InputAxisVector.X); + AddPitchInput(InputAxisVector.Y); +} diff --git a/Source/Exo/Public/Characters/ExoCharacterBase.h b/Source/Exo/Public/Characters/ExoCharacterBase.h new file mode 100644 index 0000000..4a0a2ea --- /dev/null +++ b/Source/Exo/Public/Characters/ExoCharacterBase.h @@ -0,0 +1,29 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Character.h" +#include "ExoCharacterBase.generated.h" + +UCLASS() +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; + +}; diff --git a/Source/Exo/Public/Game/ExoGameMode.h b/Source/Exo/Public/Game/ExoGameMode.h new file mode 100644 index 0000000..d61572b --- /dev/null +++ b/Source/Exo/Public/Game/ExoGameMode.h @@ -0,0 +1,17 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/GameModeBase.h" +#include "ExoGameMode.generated.h" + +/** + * + */ +UCLASS() +class EXO_API AExoGameMode : public AGameModeBase +{ + GENERATED_BODY() + +}; diff --git a/Source/Exo/Public/Player/ExoPlayerController.h b/Source/Exo/Public/Player/ExoPlayerController.h new file mode 100644 index 0000000..71e8d84 --- /dev/null +++ b/Source/Exo/Public/Player/ExoPlayerController.h @@ -0,0 +1,46 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/PlayerController.h" +#include "ExoPlayerController.generated.h" + +class UInputMappingContext; +class UInputAction; +struct FInputActionValue; + +UCLASS() +class EXO_API AExoPlayerController : public APlayerController +{ + GENERATED_BODY() + +public: + AExoPlayerController(); + + virtual void BeginPlay() override; + + virtual void PlayerTick(float DeltaTime) override; + +protected: + virtual void SetupInputComponent() override; + + UFUNCTION(BlueprintCallable, Category = "Input") + void Move(const FInputActionValue& InputActionValue); + + UFUNCTION(BlueprintCallable, Category = "Input") + void Look(const FInputActionValue& InputActionValue); + +protected: + UPROPERTY(EditAnywhere, Category = "Input") + TObjectPtr InputContext; + + UPROPERTY(EditAnywhere, Category= "Input") + TObjectPtr MoveAction; + + UPROPERTY(EditAnywhere, Category = "Input") + TObjectPtr LookAction; + + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Character") + TObjectPtr PlayerCharacter; +};