diff --git a/KOFForever/Config/DefaultEngine.ini b/KOFForever/Config/DefaultEngine.ini index 98f4b8c..7bc5b44 100644 --- a/KOFForever/Config/DefaultEngine.ini +++ b/KOFForever/Config/DefaultEngine.ini @@ -1,7 +1,7 @@ [/Script/EngineSettings.GameMapsSettings] -EditorStartupMap=/Game/Maps/TrainingStage/TrainingStage.TrainingStage +EditorStartupMap=/Game/Maps/Debug/DebugStage.DebugStage LocalMapOptions= TransitionMap= bUseSplitscreen=True @@ -37,3 +37,7 @@ r.Editor.SkipSourceControlCheckForEditablePackages = 1 [/Script/Engine.RendererSettings] r.DefaultFeature.AntiAliasing=0 + +[CoreRedirects] ++ClassRedirects=(OldName="/Script/KOFForever.KOFRenderableCharacter",NewName="/Script/KOFForever.KOFBaseCharacter") + diff --git a/KOFForever/Config/DefaultInput.ini b/KOFForever/Config/DefaultInput.ini index fdfa0dd..75cf6d4 100644 --- a/KOFForever/Config/DefaultInput.ini +++ b/KOFForever/Config/DefaultInput.ini @@ -1,4 +1,5 @@ + [/Script/Engine.InputSettings] -AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) -AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) @@ -6,32 +7,91 @@ -AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) -AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) -AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) ++AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Touch",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) bAltEnterTogglesFullscreen=True +bF11TogglesFullscreen=True bUseMouseForTouch=False bEnableMouseSmoothing=True bEnableFOVScaling=True -FOVScale=0.011110 -DoubleClickTime=0.200000 -+ActionMappings=(ActionName="Jump",Key=W,bShift=False,bCtrl=False,bAlt=False,bCmd=False) -+ActionMappings=(ActionName="Jump",Key=Up,bShift=False,bCtrl=False,bAlt=False,bCmd=False) -+ActionMappings=(ActionName="Jump",Key=SpaceBar,bShift=False,bCtrl=False,bAlt=False,bCmd=False) -+ActionMappings=(ActionName="Jump",Key=Gamepad_FaceButton_Bottom,bShift=False,bCtrl=False,bAlt=False,bCmd=False) -+AxisMappings=(AxisName="MoveRight",Key=A,Scale=-1.000000) -+AxisMappings=(AxisName="MoveRight",Key=D,Scale=1.000000) -+AxisMappings=(AxisName="MoveRight",Key=Gamepad_LeftX,Scale=1.000000) -+AxisMappings=(AxisName="MoveRight",Key=Left,Scale=-1.000000) -+AxisMappings=(AxisName="MoveRight",Key=Right,Scale=1.000000) +bCaptureMouseOnLaunch=True bAlwaysShowTouchInterface=False bShowConsoleOnFourFingerTap=True +bEnableGestureRecognizer=False +bUseAutocorrect=False +DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown +DefaultViewportMouseLockMode=LockOnCapture +FOVScale=0.011110 +DoubleClickTime=0.200000 ++ActionMappings=(ActionName="Up",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=W) ++ActionMappings=(ActionName="Down",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=S) ++ActionMappings=(ActionName="Up",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_DPad_Up) ++ActionMappings=(ActionName="Down",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_DPad_Down) ++ActionMappings=(ActionName="Left",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=A) ++ActionMappings=(ActionName="Right",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=D) ++ActionMappings=(ActionName="Left",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_DPad_Left) ++ActionMappings=(ActionName="Right",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_DPad_Right) ++AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D) ++AxisMappings=(AxisName="MoveRight",Scale=-1.000000,Key=A) +DefaultPlayerInputClass=/Script/Engine.PlayerInput +DefaultInputComponentClass=/Script/Engine.InputComponent DefaultTouchInterface=/Engine/MobileResources/HUD/LeftVirtualJoystickOnly.LeftVirtualJoystickOnly -ConsoleKey=None -ConsoleKeys=Tilde +ConsoleKeys=Tilde - diff --git a/KOFForever/Content/Characters/Terry/BP_Terry.uasset b/KOFForever/Content/Characters/Terry/BP_Terry.uasset index 3c33bba..db2fc35 100644 --- a/KOFForever/Content/Characters/Terry/BP_Terry.uasset +++ b/KOFForever/Content/Characters/Terry/BP_Terry.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:110d1b876efd9b7d1308b5c609e8cd0033ec9cf3409edede6ae76b001d6e2110 -size 22958 +oid sha256:57c0b34510c384e3b438b2ad767b822d84c795b7cf5dafa416d333acacc56d52 +size 22440 diff --git a/KOFForever/Content/Characters/Terry/BP_TerryRender.uasset b/KOFForever/Content/Characters/Terry/BP_TerryRender.uasset deleted file mode 100644 index 47e4ec8..0000000 --- a/KOFForever/Content/Characters/Terry/BP_TerryRender.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d05ec71cf9af7eca0706a450ff1285853180aa91fe008ea0d74363e6a3825c80 -size 21461 diff --git a/KOFForever/Content/Characters/Terry/BP_Terry_DEPRECATED.uasset b/KOFForever/Content/Characters/Terry/BP_Terry_DEPRECATED.uasset new file mode 100644 index 0000000..d9d17ec --- /dev/null +++ b/KOFForever/Content/Characters/Terry/BP_Terry_DEPRECATED.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dce8bb7e9a7593962050508b0656e7766a0064caf13ff17422a0b456e4823e9e +size 23101 diff --git a/KOFForever/Content/Core/BP_MainGameMode.uasset b/KOFForever/Content/Core/BP_MainGameMode.uasset index 9e407f5..9a086bf 100644 --- a/KOFForever/Content/Core/BP_MainGameMode.uasset +++ b/KOFForever/Content/Core/BP_MainGameMode.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14b8efed0eec630f3b56900121bd19580f366058af0d8017d2a6099846f7d1d3 -size 18350 +oid sha256:dd82cb4b7fb7559ddd0fecc987f5e2195e85b14adb5527e6735513d21925d7a1 +size 18404 diff --git a/KOFForever/Content/Debug/BP_DebugGameMode.uasset b/KOFForever/Content/Debug/BP_DebugGameMode.uasset index 20b1415..1ba6882 100644 --- a/KOFForever/Content/Debug/BP_DebugGameMode.uasset +++ b/KOFForever/Content/Debug/BP_DebugGameMode.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7770532361694fba926359a02f4874cec86d186ebf88b22a2e308c29d4bf8f17 -size 18779 +oid sha256:fa96cd9ed87d1f614ffbc679c9dff7d18d26f517a3b9509fd41ceed0ef40d4c6 +size 18342 diff --git a/KOFForever/Content/Maps/Debug/DebugStage.umap b/KOFForever/Content/Maps/Debug/DebugStage.umap new file mode 100644 index 0000000..b3044c1 --- /dev/null +++ b/KOFForever/Content/Maps/Debug/DebugStage.umap @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6164a19e16259a981fedafa4a58f804c2176e471c90e07947cff26e4179660e8 +size 80135 diff --git a/KOFForever/Content/Maps/TrainingStage/TrainingStage.umap b/KOFForever/Content/Maps/TrainingStage/TrainingStage.umap index 670c437..374d5d1 100644 --- a/KOFForever/Content/Maps/TrainingStage/TrainingStage.umap +++ b/KOFForever/Content/Maps/TrainingStage/TrainingStage.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d73608c1762344a4acb52bc315868842253aa5f2a61fec9f228d12c68e01caa0 -size 81935 +oid sha256:511505a8c4e20e5f3b1c82b076b3709b1303075a882e0ed00d876c84bd659560 +size 80603 diff --git a/KOFForever/Source/KOFForever/KOFForever.Build.cs b/KOFForever/Source/KOFForever/KOFForever.Build.cs index 3834df4..a496457 100644 --- a/KOFForever/Source/KOFForever/KOFForever.Build.cs +++ b/KOFForever/Source/KOFForever/KOFForever.Build.cs @@ -9,5 +9,6 @@ public class KOFForever : ModuleRules PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Paper2D", "UnrealEd" }); + PrivateDependencyModuleNames.AddRange( new string [] {"FixedPointMath"}); } } diff --git a/KOFForever/Source/KOFForever/KOFForever.h b/KOFForever/Source/KOFForever/KOFForever.h index 8e53bcb..a96d49b 100644 --- a/KOFForever/Source/KOFForever/KOFForever.h +++ b/KOFForever/Source/KOFForever/KOFForever.h @@ -2,4 +2,4 @@ #pragma once -#include "CoreMinimal.h" +#include "CoreMinimal.h" \ No newline at end of file diff --git a/KOFForever/Source/KOFForever/KOFTypes.h b/KOFForever/Source/KOFForever/KOFTypes.h new file mode 100644 index 0000000..a29926f --- /dev/null +++ b/KOFForever/Source/KOFForever/KOFTypes.h @@ -0,0 +1,18 @@ +#include "KOFTypes.generated.h" +#pragma once + +UENUM(BlueprintType) +enum class EVirtualGamePadButton : uint8 +{ + VGP_Up UMETA(DisplayName="Up"), + VGP_Down UMETA(DisplayName="Down"), + VGP_Left UMETA(DisplayName="Left"), + VGP_Right UMETA(DisplayName="Right"), + VGP_A UMETA(DisplayName="A"), + VGP_B UMETA(DisplayName="B"), + VGP_C UMETA(DisplayName="C"), + VGP_D UMETA(DisplayName="D"), + VGP_Assist1 UMETA(DisplayName="Assist 1"), + VGP_Assist2 UMETA(DisplayName="Assist 2"), + VGP_MAX, +}; \ No newline at end of file diff --git a/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp b/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp index 9687f0f..d46ebc8 100644 --- a/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp +++ b/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp @@ -1,5 +1,118 @@ -// A fan game by poret. This game is not affiliated with SNK. This is a fan game which is not being sold or distributed for profit. - - -#include "Character/KOFBaseCharacter.h" - +// A fan game by poret. This game is not affiliated with SNK. This is a fan game which is not being sold or distributed for profit. + + +#include "Character/KOFBaseCharacter.h" + +#include "PaperFlipbookComponent.h" +#include "Components/InputComponent.h" +#include "KOFForever/KOFTypes.h" + +// Sets default values +AKOFBaseCharacter::AKOFBaseCharacter() +{ + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = true; + + Sprite = CreateOptionalDefaultSubobject(TEXT("Sprite")); + if (Sprite) + { + Sprite->AlwaysLoadOnClient = true; + Sprite->AlwaysLoadOnServer = true; + Sprite->bOwnerNoSee = false; + Sprite->bAffectDynamicIndirectLighting = true; + Sprite->SetupAttachment(RootComponent); + Sprite->SetRelativeLocation(FVector(0.0f, 0.0f, 96.0f)); + } + + // Try to create the sprite component + Shadow = CreateOptionalDefaultSubobject(TEXT("Shadow")); + if (Shadow) + { + Shadow->AlwaysLoadOnClient = true; + Shadow->AlwaysLoadOnServer = true; + Shadow->bOwnerNoSee = false; + Shadow->bAffectDynamicIndirectLighting = true; + Shadow->SetupAttachment(Sprite); + //Shadow->SetRelativeLocation(FVector(0.0f, 0.0f, -96.0f)); + Shadow->SetRelativeScale3D(FVector(1.0f, 1.0f, -0.3f)); + Shadow->SetSpriteColor(FLinearColor::Black); + } + + MaxWalkSpeed = 400; +} + +void AKOFBaseCharacter::SetPosition(FFixedVector Param) +{ + Position = Param; +} + +void AKOFBaseCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) +{ + Super::SetupPlayerInputComponent(PlayerInputComponent); + + PlayerInputComponent->BindAxis("MoveRight", this, &AKOFBaseCharacter::MoveRight); + + RegisterInput("Up", EVirtualGamePadButton::VGP_Up); + RegisterInput("Down", EVirtualGamePadButton::VGP_Down); + RegisterInput("Left", EVirtualGamePadButton::VGP_Left); + RegisterInput("Right", EVirtualGamePadButton::VGP_Right); +} + +void AKOFBaseCharacter::ProcessInputs(EVirtualGamePadButton Button) +{ + /* + switch(Button) + { + case EVirtualGamePadButton::VGP_Left: + Position = FFixedVector(0, -250, 0); + break; + case EVirtualGamePadButton::VGP_Right: + Position = FFixedVector(0, 250, 0); + break; + } + */ +} + +void AKOFBaseCharacter::RegisterInput(FName ActionName, EVirtualGamePadButton Button) +{ + check(InputComponent != nullptr); + + FInputActionHandlerSignature ActionHandler; + ActionHandler.BindUObject(this, &AKOFBaseCharacter::ProcessInputs, Button); + + FInputActionBinding ActionBinding(ActionName, IE_Pressed); + ActionBinding.ActionDelegate = ActionHandler; + InputComponent->AddActionBinding(ActionBinding); +} + +void AKOFBaseCharacter::MoveRight(float Axis) +{ + Direction = Axis; +} + +void AKOFBaseCharacter::UpdateMovement(FFixed DeltaTime) +{ + FFixedVector Velocity = FFixedVector(0, Direction * MaxWalkSpeed, 0); + Position += Velocity * DeltaTime; +} + +// Called when the game starts or when spawned +void AKOFBaseCharacter::BeginPlay() +{ + Super::BeginPlay(); + + SetActorLocation(FVector(Position)); + SetActorRotation(FRotator(0.0f, 90.0f, 0.0f)); +} + +// Called every frame +void AKOFBaseCharacter::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + + UpdateMovement(FFixed(DeltaTime)); + + // might need some helpers to convert a FFixedVector to a FVector + SetActorRelativeLocation(FVector(Position)); +} + diff --git a/KOFForever/Source/KOFForever/Private/Character/KOFRenderableCharacter.cpp b/KOFForever/Source/KOFForever/Private/Character/KOFRenderableCharacter.cpp deleted file mode 100644 index 5d07fe1..0000000 --- a/KOFForever/Source/KOFForever/Private/Character/KOFRenderableCharacter.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// A fan game by poret. This game is not affiliated with SNK. This is a fan game which is not being sold or distributed for profit. - - -#include "Character/KOFRenderableCharacter.h" - -#include "PaperFlipbookComponent.h" - -// Sets default values -AKOFRenderableCharacter::AKOFRenderableCharacter() -{ - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. - PrimaryActorTick.bCanEverTick = true; - - Sprite = CreateOptionalDefaultSubobject(TEXT("Sprite")); - if (Sprite) - { - Sprite->AlwaysLoadOnClient = true; - Sprite->AlwaysLoadOnServer = true; - Sprite->bOwnerNoSee = false; - Sprite->bAffectDynamicIndirectLighting = true; - Sprite->SetupAttachment(RootComponent); - } - - // Try to create the sprite component - Shadow = CreateOptionalDefaultSubobject(TEXT("Shadow")); - if (Shadow) - { - Shadow->AlwaysLoadOnClient = true; - Shadow->AlwaysLoadOnServer = true; - Shadow->bOwnerNoSee = false; - Shadow->bAffectDynamicIndirectLighting = true; - Shadow->SetupAttachment(Sprite); - Shadow->SetRelativeScale3D(FVector(1.0f, 1.0f, -0.3f)); - Shadow->SetSpriteColor(FLinearColor::Black); - } -} - -// Called when the game starts or when spawned -void AKOFRenderableCharacter::BeginPlay() -{ - Super::BeginPlay(); - -} - -// Called every frame -void AKOFRenderableCharacter::Tick(float DeltaTime) -{ - Super::Tick(DeltaTime); - -} - diff --git a/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h b/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h index 87512d5..c84cba9 100644 --- a/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h +++ b/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h @@ -1,17 +1,65 @@ -// A fan game by poret. This game is not affiliated with SNK. This is a fan game which is not being sold or distributed for profit. - -#pragma once - -#include "CoreMinimal.h" -#include "UObject/NoExportTypes.h" -#include "KOFBaseCharacter.generated.h" - -/** - * - */ -UCLASS(Blueprintable, meta=(ShortTooltip="Base class responsible for handling all character logic.")) -class KOFFOREVER_API UKOFBaseCharacter : public UObject -{ - GENERATED_BODY() - -}; +// A fan game by poret. This game is not affiliated with SNK. This is a fan game which is not being sold or distributed for profit. + +#pragma once + +#include "CoreMinimal.h" +#include "../../../../Plugins/FixedPointMath/Source/FixedPointMath/Public/FixedVector.h" +#include "GameFramework/Actor.h" +#include "KOFBaseCharacter.generated.h" + +enum class EVirtualGamePadButton : uint8; +UCLASS() +class KOFFOREVER_API AKOFBaseCharacter : public APawn +{ + GENERATED_BODY() + +public: + // Sets default values for this actor's properties + AKOFBaseCharacter(); + + void SetPosition(FFixedVector Param); + +protected: + /** The main flipbook representing the character */ + UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) + class UPaperFlipbookComponent* Sprite; + + /** + * Secondary sprite that is mirrored across the ground axis and set to black to give the effect of a + * character's shadow + */ + UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) + class UPaperFlipbookComponent* Shadow; + + // movement + // need a way to expose this to the editor as a float slider/entry + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Settings|Movement") + FFixed MaxWalkSpeed; + + int Direction; + + FFixedVector Position; + + /** + * + * @param PlayerInputComponent + */ + virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; + + // for now just takes a button but eventually will take an entire gamepad state + void ProcessInputs(EVirtualGamePadButton Button); + + void RegisterInput(FName ActionName, EVirtualGamePadButton Button); + + void MoveRight(float Axis); + + void UpdateMovement(FFixed DeltaTime); + + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void Tick(float DeltaTime) override; + +}; diff --git a/KOFForever/Source/KOFForever/Public/Character/KOFRenderableCharacter.h b/KOFForever/Source/KOFForever/Public/Character/KOFRenderableCharacter.h deleted file mode 100644 index 6eb71e5..0000000 --- a/KOFForever/Source/KOFForever/Public/Character/KOFRenderableCharacter.h +++ /dev/null @@ -1,37 +0,0 @@ -// A fan game by poret. This game is not affiliated with SNK. This is a fan game which is not being sold or distributed for profit. - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/Actor.h" -#include "KOFRenderableCharacter.generated.h" - -UCLASS() -class KOFFOREVER_API AKOFRenderableCharacter : public AActor -{ - GENERATED_BODY() - -public: - // Sets default values for this actor's properties - AKOFRenderableCharacter(); - -protected: - /** The main flipbook representing the character */ - UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) - class UPaperFlipbookComponent* Sprite; - - /** - * Secondary sprite that is mirrored across the ground axis and set to black to give the effect of a - * character's shadow - */ - UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) - class UPaperFlipbookComponent* Shadow; - - // Called when the game starts or when spawned - virtual void BeginPlay() override; - -public: - // Called every frame - virtual void Tick(float DeltaTime) override; - -};