diff --git a/SeagullGame/Content/John/BP_John.uasset b/SeagullGame/Content/John/BP_John.uasset index 86c0675..022129f 100644 --- a/SeagullGame/Content/John/BP_John.uasset +++ b/SeagullGame/Content/John/BP_John.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2aabd6684ee3e3d9da1be25b6228c122b090f944b6d3f0f8c336191505a48361 -size 164502 +oid sha256:95cc06fc059a5826c9aa39a715734fef88bfa2a4b07968dd82a3f6eb39749e64 +size 162127 diff --git a/SeagullGame/Content/TopDown/Blueprints/BP_SeagullPlayer.uasset b/SeagullGame/Content/TopDown/Blueprints/BP_SeagullPlayer.uasset index 78b532c..a72f4eb 100644 --- a/SeagullGame/Content/TopDown/Blueprints/BP_SeagullPlayer.uasset +++ b/SeagullGame/Content/TopDown/Blueprints/BP_SeagullPlayer.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97ef5226c481dad8cac084852d40f4ec9f00fab947a5e4879d4534afe63ad834 -size 294924 +oid sha256:04c59020793d2f955627f5577bebf4b669e66e69d669e0fb3e9070a37fdf8661 +size 295413 diff --git a/SeagullGame/Content/TopDown/Blueprints/edwin_loaf.uasset b/SeagullGame/Content/TopDown/Blueprints/edwin_loaf.uasset new file mode 100644 index 0000000..0903a27 --- /dev/null +++ b/SeagullGame/Content/TopDown/Blueprints/edwin_loaf.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccbfd97100140a90643259420b0947636301243af28887830a9e718c535e3a4e +size 53005 diff --git a/SeagullGame/Content/TopDown/Blueprints/standardSurface1.uasset b/SeagullGame/Content/TopDown/Blueprints/standardSurface1.uasset new file mode 100644 index 0000000..0a9f908 --- /dev/null +++ b/SeagullGame/Content/TopDown/Blueprints/standardSurface1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b7acc191e404f1803057872eaf78ea5c23f4f5add60f2f39aeed689fac5c248 +size 8118 diff --git a/SeagullGame/Content/TopDown/Input/Actions/IAS_Crouch.uasset b/SeagullGame/Content/TopDown/Input/Actions/IAS_Crouch.uasset new file mode 100644 index 0000000..f718a80 --- /dev/null +++ b/SeagullGame/Content/TopDown/Input/Actions/IAS_Crouch.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d3eff167552d60a43e440905eacd0da3a9e3e4ac43c9eb5dfa2b6709a0656bd +size 1357 diff --git a/SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset b/SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset index e389cd5..afb26db 100644 --- a/SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset +++ b/SeagullGame/Content/TopDown/Input/IMC_DefaultMain.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:24d6413be681637d45e7400e0e0206cd33504b0e3c4e7358f9e7db0e562e1774 -size 14137 +oid sha256:25e89c763885e45caa0a3398b5776297a3fd79077856c95269baa8b2f11d30a4 +size 14721 diff --git a/SeagullGame/Content/__ExternalActors__/TopDown/Maps/TopDownMap/8/4X/3W1TJMD96Q8MJD7QM7AWU7.uasset b/SeagullGame/Content/__ExternalActors__/TopDown/Maps/TopDownMap/8/4X/3W1TJMD96Q8MJD7QM7AWU7.uasset index 06b3d42..6aae57b 100644 --- a/SeagullGame/Content/__ExternalActors__/TopDown/Maps/TopDownMap/8/4X/3W1TJMD96Q8MJD7QM7AWU7.uasset +++ b/SeagullGame/Content/__ExternalActors__/TopDown/Maps/TopDownMap/8/4X/3W1TJMD96Q8MJD7QM7AWU7.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c56f6ba9ea8f958df832546937e89b60b1c7a9f274e56c8e47354d09c70b582 +oid sha256:33935d84d4f215ec4f0dc21f177990b1f1b1c0d1a894a6fe3bd7cfca4134b955 size 7101 diff --git a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp index 89e1b34..4beb3e4 100644 --- a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp +++ b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.cpp @@ -156,6 +156,22 @@ void ASeagullGameCharacter::EndGame() OnGameEnd.Broadcast("You Win!"); } +void ASeagullGameCharacter::CrouchActionPressed(const FInputActionValue& Value) +{ + GetMesh()->SetVisibility(false); + TArray ActorComponents = GetComponentsByTag(UStaticMeshComponent::StaticClass(), "Loaf"); + UStaticMeshComponent* StaticMeshComponent = Cast(ActorComponents[0]); + StaticMeshComponent->SetVisibility(true); +} + +void ASeagullGameCharacter::CrouchActionUnPressed(const FInputActionValue& Value) +{ + GetMesh()->SetVisibility(true); + TArray ActorComponents = GetComponentsByTag(UStaticMeshComponent::StaticClass(), "Loaf"); + UStaticMeshComponent* StaticMeshComponent = Cast(ActorComponents[0]); + StaticMeshComponent->SetVisibility(false); +} + void ASeagullGameCharacter::PickupItem() { OnPlayerPickupItem.Broadcast(); @@ -229,6 +245,10 @@ void ASeagullGameCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInp //Pickup EnhancedInputComponent->BindAction(PickupAction, ETriggerEvent::Started, this, &ASeagullGameCharacter::PickupItem); + + //Crouch + EnhancedInputComponent->BindAction(CrouchAction, ETriggerEvent::Started, this, &ASeagullGameCharacter::CrouchActionPressed); + EnhancedInputComponent->BindAction(CrouchAction, ETriggerEvent::Completed, this, &ASeagullGameCharacter::CrouchActionUnPressed); } } diff --git a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h index c32edf3..ed35496 100644 --- a/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h +++ b/SeagullGame/Source/SeagullGame/SeagullGameCharacter.h @@ -53,6 +53,10 @@ public: UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) class UInputAction* PickupAction; + /** Crouch Input Action */ + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) + class UInputAction* CrouchAction; + /** Move Input Action */ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true")) class UInputAction* MoveAction; @@ -85,6 +89,10 @@ public: float GameTime = 120; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "General") float Score = 0; + UFUNCTION(Category = "General") + void CrouchActionPressed(const FInputActionValue& Value); + UFUNCTION(Category = "General") + void CrouchActionUnPressed(const FInputActionValue& Value); UFUNCTION(BlueprintCallable, Category = "Item") void PickupItem();