diff --git a/KOFForever/Content/Characters/Terry/BP_Terry.uasset b/KOFForever/Content/Characters/Terry/BP_Terry.uasset index e76ef5e..5fa30a9 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:b72d8cef5f698ec47ec1578b6de47f8341e8e374212f386a863de1d963aa722a -size 23904 +oid sha256:128c8293811e215201ce3eeb1989873114e135d0541aab064868a7e99fa837d8 +size 24084 diff --git a/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump.uasset b/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump.uasset new file mode 100644 index 0000000..8326982 --- /dev/null +++ b/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c57edb57c1954be15dd3f2b5e781a1b162d31ce41a360f5110889adeae8d20be +size 12264 diff --git a/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump1.uasset b/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump1.uasset new file mode 100644 index 0000000..a58d622 --- /dev/null +++ b/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da401f4ba5ec8789e7568d7b9c1e4a74f55de5ab7fcd1842144645a9f4b4606c +size 16676 diff --git a/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump2.uasset b/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump2.uasset new file mode 100644 index 0000000..5a3555c --- /dev/null +++ b/KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump2.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad252be9575210686c0eee9ebf775b5906c0285bff9885f337b8ba07e9dfd5d3 +size 16061 diff --git a/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp b/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp index e68ec39..bce5e20 100644 --- a/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp +++ b/KOFForever/Source/KOFForever/Private/Character/KOFBaseCharacter.cpp @@ -71,20 +71,28 @@ UPaperFlipbook* AKOFBaseCharacter::GetAnimation(FName Key) void AKOFBaseCharacter::UpdateAnimation() { + // need to get the animation based on what state we're in... // rendering if(!bIsInAir) { - if(Direction > 0) + if(bWantsToJump) { - SetAnimationFlipbook("WALK_FWD"); - } - else if (Direction < 0) - { - SetAnimationFlipbook("WALK_BACK"); + SetAnimationFlipbook("PRE_JUMP"); } else { - SetAnimationFlipbook("IDLE"); + if(Direction > 0) + { + SetAnimationFlipbook("WALK_FWD"); + } + else if (Direction < 0) + { + SetAnimationFlipbook("WALK_BACK"); + } + else + { + SetAnimationFlipbook("IDLE"); + } } } else @@ -124,7 +132,7 @@ void AKOFBaseCharacter::ProcessInputs(EVirtualGamePadButton Button) switch(Button) { case EVirtualGamePadButton::VGP_Up: - Jump(); + bWantsToJump = true; break; } } @@ -202,6 +210,16 @@ void AKOFBaseCharacter::Tick(float DeltaTime) { Super::Tick(DeltaTime); + if(!bIsInAir && bWantsToJump) + { + TicksSinceJumpRequested++; + if(TicksSinceJumpRequested >= 4) + { + Jump(); + TicksSinceJumpRequested = 0; + bWantsToJump = false; + } + } // character logic UpdateMovement(FFixed(DeltaTime)); diff --git a/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h b/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h index 5745c59..b9df248 100644 --- a/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h +++ b/KOFForever/Source/KOFForever/Public/Character/KOFBaseCharacter.h @@ -98,6 +98,9 @@ protected: void UpdateMovement(FFixed DeltaTime); bool bIsInAir; + + bool bWantsToJump; + int TicksSinceJumpRequested; void Jump();