Initial commit

Initial commit
This commit is contained in:
Kevin Poretti 2022-01-10 17:01:28 -05:00
commit bb41329352
91 changed files with 749 additions and 0 deletions

12
.gitattributes vendored Normal file
View File

@ -0,0 +1,12 @@
*.uasset filter=lfs diff=lfs merge=lfs -text
*.umap filter=lfs diff=lfs merge=lfs -text
# Raw Content types
*.fbx filter=lfs diff=lfs merge=lfs -text
*.3ds filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
*.xcf filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text

70
.gitignore vendored Normal file
View File

@ -0,0 +1,70 @@
# Visual Studio user specific files
**/.vs/
# Rider
**/.idea/
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
*.ipa
# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb
# Binary Files
**/Binaries/*
**/Plugins/*/Binaries/*
# Builds
**/Build/*
# Whitelist PakBlacklist-<BuildConfiguration>.txt files
!Build/*/
Build/*/**
!Build/*/PakBlacklist*.txt
# Don't ignore icon files in Build
!Build/**/*.ico
# Built data for maps
*_BuiltData.uasset
# Configuration files generated by the Editor
**/Saved/*
# Compiled source files for the engine to use
**/Intermediate/*
**/Plugins/*/Intermediate/*
# Cache files for the editor to use
**/DerivedDataCache/*

BIN
Assets/Sprites/Characters/KOF02_Terry.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,15 @@
[UnrealEd.SimpleMap]
SimpleMapName=/Game/SideScroller/Maps/SideScrollerExampleMap
[EditoronlyBP]
bAllowClassAndBlueprintPinMatching=true
bReplaceBlueprintWithClass= true
bDontLoadBlueprintOutsideEditor= true
bBlueprintIsNotBlueprintType= true
[/Script/UnrealEd.LevelEditor2DSettings]
bEnableSnapLayers=True
SnapAxis=X
+SnapLayers=(Name="Foreground",Depth=1500.000000)
+SnapLayers=(Name="Default",Depth=1200.000000)
+SnapLayers=(Name="Background",Depth=900.000000)

View File

@ -0,0 +1,2 @@
[ContentBrowser]
ContentBrowserTab1.SelectedPaths=/Game/SideScroller

View File

@ -0,0 +1,33 @@
[/Script/EngineSettings.GameMapsSettings]
EditorStartupMap=/Game/SideScrollerCPP/Maps/SideScrollerExampleMap
LocalMapOptions=
TransitionMap=
bUseSplitscreen=True
TwoPlayerSplitscreenLayout=Horizontal
ThreePlayerSplitscreenLayout=FavorTop
GameInstanceClass=/Script/Engine.GameInstance
GameDefaultMap=/Game/SideScrollerCPP/Maps/SideScrollerExampleMap
ServerDefaultMap=/Engine/Maps/Entry
GlobalDefaultGameMode=/Script/KOFForever.KOFForeverGameMode
GlobalDefaultServerGameMode=None
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
MinimumiOSVersion=IOS_12
[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum
[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_SideScroller",NewGameName="/Script/KOFForever")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_SideScroller",NewGameName="/Script/KOFForever")
+ActiveClassRedirects=(OldClassName="TP_SideScrollerGameMode",NewClassName="KOFForeverGameMode")
+ActiveClassRedirects=(OldClassName="TP_SideScrollerCharacter",NewClassName="KOFForeverCharacter")
[SystemSettingsEditor]
r.Editor.SkipSourceControlCheckForEditablePackages = 1

View File

@ -0,0 +1,7 @@
[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=F97C7B07434EBE9C17C76892FC009E34
ProjectName=Side Scroller Game Template
[StartupActions]
bAddPacks=True
InsertPack=(PackSource="StarterContent.upack",PackName="StarterContent")

View File

@ -0,0 +1,37 @@
[/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))
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-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="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))
bAltEnterTogglesFullscreen=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)
bAlwaysShowTouchInterface=False
bShowConsoleOnFourFingerTap=True
DefaultTouchInterface=/Engine/MobileResources/HUD/LeftVirtualJoystickOnly.LeftVirtualJoystickOnly
ConsoleKey=None
-ConsoleKeys=Tilde
+ConsoleKeys=Tilde

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
KOFForever/Content/Characters/Terry/BP_Terry.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
KOFForever/Content/Geometry/Meshes/1M_Cube.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
KOFForever/Content/Geometry/Meshes/1M_Cube_Chamfer.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
KOFForever/Content/Geometry/Meshes/CubeMaterial.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
KOFForever/Content/Geometry/Meshes/TemplateFloor.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,16 @@
{
"FileVersion": 3,
"EngineAssociation": "4.26",
"Category": "",
"Description": "",
"Modules": [
{
"Name": "KOFForever",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Paper2D"
]
}
]
}

@ -0,0 +1 @@
Subproject commit 1a3f369d065023db98cd1bdba82bc3399b38526c

@ -0,0 +1 @@
Subproject commit e00a13361794e7523a86183985e1f6168197b997

View File

@ -0,0 +1,14 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class KOFForeverTarget : TargetRules
{
public KOFForeverTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V2;
ExtraModuleNames.Add("KOFForever");
}
}

View File

@ -0,0 +1,13 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class KOFForever : ModuleRules
{
public KOFForever(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Paper2D" });
}
}

View File

@ -0,0 +1,7 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "KOFForever.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, KOFForever, "KOFForever" );

View File

@ -0,0 +1,5 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"

View File

@ -0,0 +1,197 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Character/KOFBaseCharacter.h"
#include "Camera/CameraComponent.h"
#include "Components/CapsuleComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "PaperFlipbookComponent.h"
DEFINE_LOG_CATEGORY_STATIC(SideScrollerCharacter, Log, All);
//////////////////////////////////////////////////////////////////////////
// ASideScroller2DCharacter
AKOFBaseCharacter::AKOFBaseCharacter()
{
// Use only Yaw from the controller and ignore the rest of the rotation.
bUseControllerRotationPitch = false;
bUseControllerRotationYaw = true;
bUseControllerRotationRoll = false;
// Set the size of our collision capsule.
GetCapsuleComponent()->SetCapsuleHalfHeight(96.0f);
GetCapsuleComponent()->SetCapsuleRadius(40.0f);
// Create a camera boom attached to the root (capsule)
CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
CameraBoom->SetupAttachment(RootComponent);
CameraBoom->TargetArmLength = 500.0f;
CameraBoom->SocketOffset = FVector(0.0f, 0.0f, 0.0f);
CameraBoom->bDoCollisionTest = false;
CameraBoom->SetRelativeRotation(FRotator(0.0f, 180.f, 0.0f));
// Create an orthographic camera (no perspective) and attach it to the boom
SideViewCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("SideViewCamera"));
SideViewCameraComponent->SetupAttachment(CameraBoom, USpringArmComponent::SocketName);
// Prevent all automatic rotation behavior on the camera, character, and camera component
CameraBoom->SetUsingAbsoluteRotation(true);
SideViewCameraComponent->bUsePawnControlRotation = false;
SideViewCameraComponent->bAutoActivate = true;
GetCharacterMovement()->bOrientRotationToMovement = false;
// Configure character movement
GetCharacterMovement()->GravityScale = 2.0f;
GetCharacterMovement()->AirControl = 0.80f;
GetCharacterMovement()->JumpZVelocity = 1000.f;
GetCharacterMovement()->GroundFriction = 3.0f;
GetCharacterMovement()->MaxWalkSpeed = 600.0f;
GetCharacterMovement()->MaxFlySpeed = 600.0f;
// Lock character motion onto the XZ plane, so the character can't move in or out of the screen
GetCharacterMovement()->bConstrainToPlane = true;
GetCharacterMovement()->SetPlaneConstraintNormal(FVector(1.0, 0.0f, 0.0f));
// Behave like a traditional 2D platformer character, with a flat bottom instead of a curved capsule bottom
// Note: This can cause a little floating when going up inclines; you can choose the tradeoff between better
// behavior on the edge of a ledge versus inclines by setting this to true or false
GetCharacterMovement()->bUseFlatBaseForFloorChecks = true;
// TextComponent = CreateDefaultSubobject<UTextRenderComponent>(TEXT("IncarGear"));
// TextComponent->SetRelativeScale3D(FVector(3.0f, 3.0f, 3.0f));
// TextComponent->SetRelativeLocation(FVector(35.0f, 5.0f, 20.0f));
// TextComponent->SetRelativeRotation(FRotator(0.0f, 90.0f, 0.0f));
// TextComponent->SetupAttachment(RootComponent);
// Enable replication on the Sprite component so animations show up when networked
GetSprite()->SetIsReplicated(true);
GetSprite()->SetRelativeLocation(FVector(0.0f, 0.0f, -96.0f));
bReplicates = true;
// Try to create the sprite component
Shadow = CreateOptionalDefaultSubobject<UPaperFlipbookComponent>(TEXT("Shadow"));
if (Shadow)
{
Shadow->AlwaysLoadOnClient = true;
Shadow->AlwaysLoadOnServer = true;
Shadow->bOwnerNoSee = false;
Shadow->bAffectDynamicIndirectLighting = true;
Shadow->PrimaryComponentTick.TickGroup = TG_PrePhysics;
Shadow->SetupAttachment(GetCapsuleComponent());
Shadow->SetRelativeLocation(FVector(0.0f, 0.0f, -96.0f));
Shadow->SetRelativeScale3D(FVector(1.0f, 1.0f, -0.3f));
Shadow->SetSpriteColor(FLinearColor::Black);
Shadow->SetTranslucentSortPriority(1000);
}
}
//////////////////////////////////////////////////////////////////////////
// Animation
void AKOFBaseCharacter::UpdateAnimation()
{
const FVector PlayerVelocity = GetVelocity();
const float PlayerSpeedSqr = PlayerVelocity.SizeSquared();
const float TravelDirection = PlayerVelocity.Y;
// Are we moving or standing still?
UPaperFlipbook* DesiredAnimation = IdleAnimation;
if(PlayerSpeedSqr > 0.0f)
{
if (TravelDirection < 0.0f)
{
DesiredAnimation = WalkFwdAnimation;
}
else if (TravelDirection > 0.0f)
{
DesiredAnimation = WalkBackAnimation;
}
}
if( GetSprite()->GetFlipbook() != DesiredAnimation )
{
GetSprite()->SetFlipbook(DesiredAnimation);
Shadow->SetFlipbook(DesiredAnimation);
}
}
void AKOFBaseCharacter::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
UpdateCharacter();
}
void AKOFBaseCharacter::BeginPlay()
{
Super::BeginPlay();
if(Controller)
{
Controller->SetControlRotation(FRotator(0.0f, -90.0f, 0.0));
}
}
void AKOFBaseCharacter::PostInitializeComponents()
{
Super::PostInitializeComponents();
if (!IsPendingKill())
{
if (Shadow)
{
// force animation tick after movement component updates
if (Shadow->PrimaryComponentTick.bCanEverTick && GetCharacterMovement())
{
Shadow->PrimaryComponentTick.AddPrerequisite(GetCharacterMovement(), GetCharacterMovement()->PrimaryComponentTick);
}
}
}
}
//////////////////////////////////////////////////////////////////////////
// Input
void AKOFBaseCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{
// Note: the 'Jump' action and the 'MoveRight' axis are bound to actual keys/buttons/sticks in DefaultInput.ini (editable from Project Settings..Input)
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping);
PlayerInputComponent->BindAxis("MoveRight", this, &AKOFBaseCharacter::MoveRight);
}
void AKOFBaseCharacter::MoveRight(float Value)
{
/*UpdateChar();*/
// Apply the input to the character motion
AddMovementInput(FVector(0.0f, -1.0f, 0.0f), Value);
}
void AKOFBaseCharacter::UpdateCharacter()
{
// Update animation to match the motion
UpdateAnimation();
/*
// Now setup the rotation of the controller based on the direction we are travelling
const FVector PlayerVelocity = GetVelocity();
float TravelDirection = PlayerVelocity.Y;
// Set the rotation so that the character faces his direction of travel.
if (Controller != nullptr)
{
if (TravelDirection < 0.0f)
{
Controller->SetControlRotation(FRotator(0.0, -90.0f, 0.0f));
}
else if (TravelDirection > 0.0f)
{
Controller->SetControlRotation(FRotator(0.0f, 90.0f, 0.0));
}
}
*/
}

View File

@ -0,0 +1,83 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "PaperCharacter.h"
#include "KOFBaseCharacter.generated.h"
class UTextRenderComponent;
/**
* This class is the default character for SideScroller2D, and it is responsible for all
* physical interaction between the player and the world.
*
* The capsule component (inherited from ACharacter) handles collision with the world
* The CharacterMovementComponent (inherited from ACharacter) handles movement of the collision capsule
* The Sprite component (inherited from APaperCharacter) handles the visuals
*/
UCLASS()
class KOFFOREVER_API AKOFBaseCharacter : public APaperCharacter
{
GENERATED_BODY()
/** Side view camera */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera, meta=(AllowPrivateAccess="true"))
class UCameraComponent* SideViewCameraComponent;
/** Camera boom positioning the camera beside the character */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class USpringArmComponent* CameraBoom;
UTextRenderComponent* TextComponent;
virtual void Tick(float DeltaSeconds) override;
virtual void BeginPlay() override;
virtual void PostInitializeComponents() override;
protected:
/**
* 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;
// The animation to play while running around
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Animations)
class UPaperFlipbook* RunningAnimation;
// The animation to play while running around
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Animations)
class UPaperFlipbook* WalkFwdAnimation;
// The animation to play while running around
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Animations)
class UPaperFlipbook* WalkBackAnimation;
// The animation to play while idle (standing still)
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Animations)
class UPaperFlipbook* IdleAnimation;
/** Called to choose the correct animation to play based on the character's movement state */
void UpdateAnimation();
/** Called for side to side input */
void MoveRight(float Value);
void UpdateCharacter();
// APawn interface
virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
// End of APawn interface
public:
AKOFBaseCharacter();
/** Returns SideViewCameraComponent subobject **/
FORCEINLINE class UCameraComponent* GetSideViewCameraComponent() const { return SideViewCameraComponent; }
/** Returns CameraBoom subobject **/
FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
FORCEINLINE class UPaperFlipbookComponent* GetShadow() const { return Shadow; }
};

View File

@ -0,0 +1,14 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class KOFForeverEditorTarget : TargetRules
{
public KOFForeverEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V2;
ExtraModuleNames.Add("KOFForever");
}
}