Trying to add pre-jump logic and animation
This commit is contained in:
		
							parent
							
								
									2eeac7443e
								
							
						
					
					
						commit
						c73e8b1c5a
					
				
							
								
								
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/BP_Terry.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/BP_Terry.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump1.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump1.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump2.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								KOFForever/Content/Characters/Terry/Sprites/PreJump/PreJump2.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -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));
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
@ -98,6 +98,9 @@ protected:
 | 
			
		||||
	void UpdateMovement(FFixed DeltaTime);
 | 
			
		||||
	
 | 
			
		||||
	bool bIsInAir;
 | 
			
		||||
 | 
			
		||||
	bool bWantsToJump;
 | 
			
		||||
	int TicksSinceJumpRequested;
 | 
			
		||||
	
 | 
			
		||||
	void Jump();
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user