-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
629 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Visual Studio 2015 user specific files | ||
.vs/ | ||
|
||
# Visual Studio 2015 database file | ||
*.VC.db | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
*.pdb | ||
*.modules | ||
*.target | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
|
||
# Fortran module files | ||
*.mod | ||
|
||
# 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 | ||
|
||
# Precompiled Assets | ||
SourceArt/**/*.png | ||
SourceArt/**/*.tga | ||
|
||
# Builds | ||
Build/* | ||
|
||
# Whitelist PakBlacklist-<BuildConfiguration>.txt files | ||
!Build/*/ | ||
Build/*/** | ||
!Build/*/PakBlacklist*.txt | ||
|
||
# Don't ignore icon files in Build | ||
!Build/**/*.ico | ||
|
||
# Configuration files generated by the Editor | ||
Saved/* | ||
|
||
# Compiled source files for the engine to use | ||
Intermediate/* | ||
|
||
# Cache files for the editor to use | ||
DerivedDataCache/* |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[UnrealEd.SimpleMap] | ||
SimpleMapName=/Game/FirstPerson/Maps/FirstPersonExampleMap | ||
|
||
[EditoronlyBP] | ||
bAllowClassAndBlueprintPinMatching=true | ||
bReplaceBlueprintWithClass= true | ||
bDontLoadBlueprintOutsideEditor= true | ||
bBlueprintIsNotBlueprintType= true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[/Script/Engine.CollisionProfile] | ||
+Profiles=(Name="Projectile",CollisionEnabled=QueryOnly,ObjectTypeName="Projectile",CustomResponses=,HelpMessage="Preset for projectiles",bCanModify=True) | ||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,Name="Projectile",DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False) | ||
+EditProfiles=(Name="Trigger",CustomResponses=((Channel=Projectile, Response=ECR_Ignore))) | ||
|
||
[/Script/EngineSettings.GameMapsSettings] | ||
EditorStartupMap=/Game/Maps/FirstPersonExampleMap.FirstPersonExampleMap | ||
LocalMapOptions= | ||
TransitionMap= | ||
bUseSplitscreen=True | ||
TwoPlayerSplitscreenLayout=Horizontal | ||
ThreePlayerSplitscreenLayout=FavorTop | ||
GameInstanceClass=/Script/Engine.GameInstance | ||
GameDefaultMap=/Game/Maps/FirstPersonExampleMap.FirstPersonExampleMap | ||
ServerDefaultMap=/Engine/Maps/Entry | ||
GlobalDefaultGameMode=/Script/FPSGame.FPSGameMode | ||
GlobalDefaultServerGameMode=None | ||
|
||
[/Script/IOSRuntimeSettings.IOSRuntimeSettings] | ||
MinimumiOSVersion=IOS_8 | ||
|
||
|
||
[/Script/Engine.Engine] | ||
+ActiveGameNameRedirects=(OldGameName="TP_FirstPerson",NewGameName="/Script/FPSGame") | ||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_FirstPerson",NewGameName="/Script/FPSGame") | ||
+ActiveClassRedirects=(OldClassName="TP_FirstPersonProjectile",NewClassName="FPSProjectile") | ||
+ActiveClassRedirects=(OldClassName="TP_FirstPersonHUD",NewClassName="FPSHUD") | ||
+ActiveClassRedirects=(OldClassName="TP_FirstPersonGameMode",NewClassName="FPSGameMode") | ||
+ActiveClassRedirects=(OldClassName="TP_FirstPersonCharacter",NewClassName="FPSCharacter") | ||
|
||
[/Script/HardwareTargeting.HardwareTargetingSettings] | ||
TargetedHardwareClass=Desktop | ||
AppliedTargetedHardwareClass=Desktop | ||
DefaultGraphicsPerformance=Maximum | ||
AppliedDefaultGraphicsPerformance=Maximum | ||
|
||
[/Script/Engine.PhysicsSettings] | ||
DefaultGravityZ=-980.000000 | ||
DefaultTerminalVelocity=4000.000000 | ||
DefaultFluidFriction=0.300000 | ||
SimulateScratchMemorySize=262144 | ||
RagdollAggregateThreshold=4 | ||
TriangleMeshTriangleMinAreaThreshold=5.000000 | ||
bEnableAsyncScene=False | ||
bEnableShapeSharing=False | ||
bEnablePCM=True | ||
bEnableStabilization=False | ||
bWarnMissingLocks=True | ||
bEnable2DPhysics=False | ||
LockedAxis=Invalid | ||
DefaultDegreesOfFreedom=Full3D | ||
BounceThresholdVelocity=200.000000 | ||
FrictionCombineMode=Average | ||
RestitutionCombineMode=Average | ||
MaxAngularVelocity=3600.000000 | ||
MaxDepenetrationVelocity=0.000000 | ||
ContactOffsetMultiplier=0.020000 | ||
MinContactOffset=2.000000 | ||
MaxContactOffset=8.000000 | ||
bSimulateSkeletalMeshOnDedicatedServer=True | ||
DefaultShapeComplexity=CTF_UseSimpleAndComplex | ||
bDefaultHasComplexCollision=True | ||
bSuppressFaceRemapTable=False | ||
bSupportUVFromHitResults=False | ||
bDisableActiveActors=False | ||
bDisableCCD=False | ||
bEnableEnhancedDeterminism=False | ||
MaxPhysicsDeltaTime=0.033333 | ||
bSubstepping=False | ||
bSubsteppingAsync=False | ||
MaxSubstepDeltaTime=0.016667 | ||
MaxSubsteps=6 | ||
SyncSceneSmoothingFactor=0.000000 | ||
AsyncSceneSmoothingFactor=0.990000 | ||
InitialAverageFrameRate=0.016667 | ||
PhysXTreeRebuildRate=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ProjectSettings] | ||
ProjectID=(A=1823396784,B=1298598689,C=1743498150,D=-2048051708) | ||
ProjectName=First Person Template | ||
|
||
|
||
[/Script/EngineSettings.GeneralProjectSettings] | ||
ProjectID=84280D9543200F6157F566BBB17DFDAE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[/Script/Engine.InputSettings] | ||
+ActionMappings=(ActionName="Jump", Key=SpaceBar) | ||
+ActionMappings=(ActionName="Jump", Key=Gamepad_FaceButton_Bottom) | ||
+ActionMappings=(ActionName="Jump",Key=MotionController_Left_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | ||
|
||
+ActionMappings=(ActionName="Fire", Key=LeftMouseButton) | ||
+ActionMappings=(ActionName="Fire", Key=Gamepad_RightTrigger) | ||
+ActionMappings=(ActionName="Fire",Key=MotionController_Right_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | ||
|
||
+ActionMappings=(ActionName="ResetVR",Key=R,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | ||
+ActionMappings=(ActionName="ResetVR",Key=MotionController_Left_Grip1,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | ||
|
||
+AxisMappings=(AxisName="MoveForward", Key=W, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=S, Scale=-1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=Up, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=Down, Scale=-1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=Gamepad_LeftY, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveForward",Key=MotionController_Left_Thumbstick_Y,Scale=-1.000000) | ||
|
||
+AxisMappings=(AxisName="MoveRight", Key=A, Scale=-1.f) | ||
+AxisMappings=(AxisName="MoveRight", Key=D, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveRight", Key=Gamepad_LeftX, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveRight",Key=MotionController_Left_Thumbstick_X,Scale=1.000000) | ||
|
||
+AxisMappings=(AxisName="TurnRate", Key=Gamepad_RightX, Scale=1.f) | ||
+AxisMappings=(AxisName="TurnRate", Key=Left, Scale=-1.f) | ||
+AxisMappings=(AxisName="TurnRate", Key=Right, Scale=1.f) | ||
+AxisMappings=(AxisName="Turn", Key=MouseX, Scale=1.f) | ||
|
||
+AxisMappings=(AxisName="LookUpRate", Key=Gamepad_RightY, Scale=1.f) | ||
+AxisMappings=(AxisName="LookUp", Key=MouseY, Scale=-1.f) |
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"FileVersion": 3, | ||
"EngineAssociation": "4.18", | ||
"Category": "", | ||
"Description": "", | ||
"Modules": [ | ||
{ | ||
"Name": "FPSGame", | ||
"Type": "Runtime", | ||
"LoadingPhase": "Default", | ||
"AdditionalDependencies": [ | ||
"Engine" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. | ||
|
||
using UnrealBuildTool; | ||
using System.Collections.Generic; | ||
|
||
public class FPSGameTarget : TargetRules | ||
{ | ||
public FPSGameTarget(TargetInfo Target) : base(Target) | ||
{ | ||
Type = TargetType.Game; | ||
ExtraModuleNames.Add("FPSGame"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. | ||
|
||
using UnrealBuildTool; | ||
|
||
public class FPSGame : ModuleRules | ||
{ | ||
public FPSGame(ReadOnlyTargetRules Target) : base(Target) | ||
{ | ||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; | ||
|
||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "FPSGame.h" | ||
#include "Modules/ModuleManager.h" | ||
|
||
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, FPSGame, "FPSGame" ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "FPSCharacter.h" | ||
#include "FPSProjectile.h" | ||
#include "Animation/AnimInstance.h" | ||
#include "Camera/CameraComponent.h" | ||
#include "Components/CapsuleComponent.h" | ||
#include "Kismet/GameplayStatics.h" | ||
|
||
|
||
AFPSCharacter::AFPSCharacter() | ||
{ | ||
// Create a CameraComponent | ||
CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera")); | ||
CameraComponent->SetupAttachment(GetCapsuleComponent()); | ||
CameraComponent->RelativeLocation = FVector(0, 0, BaseEyeHeight); // Position the camera | ||
CameraComponent->bUsePawnControlRotation = true; | ||
|
||
// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn) | ||
Mesh1PComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh")); | ||
Mesh1PComponent->SetupAttachment(CameraComponent); | ||
Mesh1PComponent->CastShadow = false; | ||
Mesh1PComponent->RelativeRotation = FRotator(2.0f, -15.0f, 5.0f); | ||
Mesh1PComponent->RelativeLocation = FVector(0, 0, -160.0f); | ||
|
||
// Create a gun mesh component | ||
GunMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("FP_Gun")); | ||
GunMeshComponent->CastShadow = false; | ||
GunMeshComponent->SetupAttachment(Mesh1PComponent, "GripPoint"); | ||
} | ||
|
||
|
||
void AFPSCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) | ||
{ | ||
// set up gameplay key bindings | ||
check(PlayerInputComponent); | ||
|
||
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); | ||
PlayerInputComponent->BindAction("Fire", IE_Pressed, this, &AFPSCharacter::Fire); | ||
|
||
PlayerInputComponent->BindAxis("MoveForward", this, &AFPSCharacter::MoveForward); | ||
PlayerInputComponent->BindAxis("MoveRight", this, &AFPSCharacter::MoveRight); | ||
|
||
PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput); | ||
PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput); | ||
} | ||
|
||
|
||
void AFPSCharacter::Fire() | ||
{ | ||
// try and fire a projectile | ||
if (ProjectileClass) | ||
{ | ||
FVector MuzzleLocation = GunMeshComponent->GetSocketLocation("Muzzle"); | ||
FRotator MuzzleRotation = GunMeshComponent->GetSocketRotation("Muzzle"); | ||
|
||
//Set Spawn Collision Handling Override | ||
FActorSpawnParameters ActorSpawnParams; | ||
ActorSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButDontSpawnIfColliding; | ||
|
||
// spawn the projectile at the muzzle | ||
GetWorld()->SpawnActor<AFPSProjectile>(ProjectileClass, MuzzleLocation, MuzzleRotation, ActorSpawnParams); | ||
} | ||
|
||
// try and play the sound if specified | ||
if (FireSound) | ||
{ | ||
UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation()); | ||
} | ||
|
||
// try and play a firing animation if specified | ||
if (FireAnimation) | ||
{ | ||
// Get the animation object for the arms mesh | ||
UAnimInstance* AnimInstance = Mesh1PComponent->GetAnimInstance(); | ||
if (AnimInstance) | ||
{ | ||
AnimInstance->PlaySlotAnimationAsDynamicMontage(FireAnimation, "Arms", 0.0f); | ||
} | ||
} | ||
} | ||
|
||
|
||
void AFPSCharacter::MoveForward(float Value) | ||
{ | ||
if (Value != 0.0f) | ||
{ | ||
// add movement in that direction | ||
AddMovementInput(GetActorForwardVector(), Value); | ||
} | ||
} | ||
|
||
|
||
void AFPSCharacter::MoveRight(float Value) | ||
{ | ||
if (Value != 0.0f) | ||
{ | ||
// add movement in that direction | ||
AddMovementInput(GetActorRightVector(), Value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "FPSGameMode.h" | ||
#include "FPSHUD.h" | ||
#include "FPSCharacter.h" | ||
#include "UObject/ConstructorHelpers.h" | ||
|
||
AFPSGameMode::AFPSGameMode() | ||
{ | ||
// set default pawn class to our Blueprinted character | ||
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/Blueprints/BP_Player")); | ||
DefaultPawnClass = PlayerPawnClassFinder.Class; | ||
|
||
// use our custom HUD class | ||
HUDClass = AFPSHUD::StaticClass(); | ||
} |
Oops, something went wrong.