diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
index 85b48aee..637c88c3 100644
--- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
+++ b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
@@ -8,12 +8,15 @@
-
+
-
+
+
+
+
@@ -26,37 +29,37 @@
-
+ {
+ "customColor": "",
+ "associatedIndex": 5
+}
- {
+ "keyToString": {
+ "C++ Project.EndlessVendetta.executor": "Run",
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "git-widget-placeholder": "HomeHub-Tutorial",
+ "ignore.virus.scanning.warn.message": "true",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "vue.rearranger.settings.migration": "true"
},
- "keyToStringList": {
- "rider.external.source.directories": [
- "C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache",
- "C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache",
- "C:\\Users\\Rafal\\AppData\\Local\\Symbols\\src"
+ "keyToStringList": {
+ "rider.external.source.directories": [
+ "C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache",
+ "C:\\Users\\Rafal\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache",
+ "C:\\Users\\Rafal\\AppData\\Local\\Symbols\\src"
]
}
-}]]>
+}
@@ -128,7 +131,8 @@
1705685810960
-
+
+
diff --git a/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap b/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap
index 3f162a92..3d831401 100644
--- a/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap
+++ b/EndlessVendetta/Content/Levels/ControlTutorialLevel.umap
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d0c7c578c43e2605d3764bc7ac575ada04d89043fc837f4c5e942431c460cd24
+oid sha256:0ef5c78925fa5ca9dfc7adfd2ca451aa52aa43d7758e3fd79bd96ec5e2b93e3f
size 17258870
diff --git a/EndlessVendetta/Content/Ships/LandingZone.uasset b/EndlessVendetta/Content/Ships/LandingZone.uasset
index 32fb9317..240c4ca7 100644
--- a/EndlessVendetta/Content/Ships/LandingZone.uasset
+++ b/EndlessVendetta/Content/Ships/LandingZone.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4ea90e487ea5bf751b7573ac6ef2be781c1efdf4e0bae7c8b95f9fbf0c4169dd
-size 113548
+oid sha256:da33d59112579d5b614efe76d99dc035e97c533fdbdaaf6a8a0c01a149c375a1
+size 119821
diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
index 7844ff33..4867a9c1 100644
--- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
+++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6ed4f40be65e3378a6aa30ae08f1347dc20a31e522d7b5bf73df9a59b7a149dd
+oid sha256:c20a9d0ff7162e4ba047faa465ec75c0f6084b4a4f7afb18958587d60d07d93a
size 66790690
diff --git a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.cpp b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.cpp
index c8cfc038..879041f9 100644
--- a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.cpp
+++ b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.cpp
@@ -14,6 +14,44 @@ ALandingZone::ALandingZone()
}
+void ALandingZone::BeginPlay()
+{
+ WaypointWidgetComponent = Cast(GetComponentByClass(UWidgetComponent::StaticClass()));
+ PlayersPawn = GetWorld()->GetFirstPlayerController()->GetPawn();
+
+ // Tick updates the waypoints transform base on players location
+ if (!IsValid(WaypointWidgetComponent) || !IsValid(PlayersPawn)) SetActorTickEnabled(false);
+
+ Super::BeginPlay();
+}
+
+void ALandingZone::Tick(float DeltaSeconds)
+{
+ Super::Tick(DeltaSeconds);
+ if (!IsWaypointVisible) return;
+ UpdateWaypointTransform();
+}
+
+void ALandingZone::UpdateWaypointTransform()
+{
+ FVector WaypointLoc = WaypointWidgetComponent->GetComponentLocation();
+ FVector PlayerLoc = PlayersPawn->GetActorLocation();
+
+ // Update rotation
+ FVector LocationDiffVector = PlayerLoc - WaypointLoc;
+ FRotator LookAtPlayerRotator = LocationDiffVector.Rotation();
+ WaypointWidgetComponent->SetWorldRotation(LookAtPlayerRotator);
+
+ // Update scale
+ double DistanceFromPlayer = LocationDiffVector.Length();
+ double ScaleMagnitude = (12.f - 0.15f) / (48000.f - 900.f);
+ double ScaleIntercept = 12.f - (48000.f * ScaleMagnitude);
+ double ResultingScale = (DistanceFromPlayer * ScaleMagnitude) + ScaleIntercept;
+ FVector WaypointScale = FVector(1, ResultingScale, ResultingScale);
+ WaypointWidgetComponent->SetWorldScale3D(WaypointScale);
+}
+
+
void ALandingZone::UpdateAllLandingZones(bool Landing)
{
TArray AllLandingZones;
@@ -22,6 +60,7 @@ void ALandingZone::UpdateAllLandingZones(bool Landing)
{
ALandingZone* LZ = Cast(LZ_Actor);
Landing ? LZ->HideWaypoint() : LZ->ShowWaypoint();
+ LZ->IsWaypointVisible = !Landing;
}
}
diff --git a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h
index 94314505..5428eaa7 100644
--- a/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h
+++ b/EndlessVendetta/Source/EndlessVendetta/SpaceShip/LandingZone.h
@@ -3,6 +3,7 @@
#pragma once
#include "CoreMinimal.h"
+#include "Components/WidgetComponent.h"
#include "EndlessVendetta/InteractionInterface.h"
#include "GameFramework/Actor.h"
#include "LandingZone.generated.h"
@@ -11,29 +12,49 @@ UCLASS()
class ENDLESSVENDETTA_API ALandingZone : public AActor, public IInteractionInterface
{
GENERATED_BODY()
-
+
+// ------------------------------ Attributes -------------------------------------------------
UPROPERTY(EditAnywhere, Category = "Landing Zone")
FTransform LZ_ExitTransform;
+
UPROPERTY(EditAnywhere, Category = "Landing Zone")
FTransform LZ_TakeoffTransform;
-
- // Hides or shows key aesthetic features of LZ's based on if the player is landing or not
- void UpdateAllLandingZones(bool Landing);
-
+ UWidgetComponent* WaypointWidgetComponent;
+
+ APawn* PlayersPawn;
protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Landing Zone")
bool IsHomeBase_LZ = false;
+public:
+ bool IsWaypointVisible = false;
+// ------------------------------ Methods -------------------------------------------------
+private:
+ // Runs when game starts or this actor spawns
+ virtual void BeginPlay() override;
+
+ // Runs once per frame
+ virtual void Tick(float DeltaSeconds) override;
+
+ // Hides or shows key aesthetic features of LZ's based on if the player is landing or not
+ void UpdateAllLandingZones(bool Landing);
+
+ // Updates waypoints rotation and scale based on players location, only if visible
+ void UpdateWaypointTransform();
+
+protected:
// Allows player to enter their ship through a LZ
void Interact() override;
+
+ // Used to implement a pop up for interaction
void InteractPrompt() override;
public:
// Sets default values for this actor's properties
ALandingZone();
-
+
// Waypoint will display something along the lines of Press F to Land
UFUNCTION(BlueprintImplementableEvent)
void SuggestLandingWidget();
@@ -41,12 +62,14 @@ public:
// Ran when a player takes off from any LZ in the world
UFUNCTION(BlueprintImplementableEvent)
void ShowWaypoint();
+
// Ran when player lands at any LZ in the world
UFUNCTION(BlueprintImplementableEvent)
void HideWaypoint();
// Updates all LZ's, then runs exit ship func on player and passes the exit transform
void Land();
+
// Updates all LZ's, then runs enter ship func on player passing the correct takeoff transform
void Takeoff();
};