mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Change bounce behavior
- Always allow bounce after fast fall - Allow for more bounces - Lose speed on bounces that don't reach max
This commit is contained in:
		
							parent
							
								
									1eb1309032
								
							
						
					
					
						commit
						eb7e2287c4
					
				
					 1 changed files with 14 additions and 6 deletions
				
			
		
							
								
								
									
										20
									
								
								src/k_kart.c
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								src/k_kart.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -9311,20 +9311,28 @@ static void K_KartSpindash(player_t *player)
 | 
			
		|||
	{
 | 
			
		||||
		// Handle fastfall bounce.
 | 
			
		||||
		const fixed_t maxBounce = player->mo->scale * 10;
 | 
			
		||||
		const fixed_t minBounce = player->mo->scale * 2;
 | 
			
		||||
		fixed_t bounce = abs(player->fastfall) / 4;
 | 
			
		||||
		const fixed_t minBounce = player->mo->scale;
 | 
			
		||||
		fixed_t bounce = 2 * abs(player->fastfall) / 3;
 | 
			
		||||
 | 
			
		||||
		if (bounce > maxBounce)
 | 
			
		||||
		{
 | 
			
		||||
			bounce = maxBounce;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (bounce > minBounce)
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			S_StartSound(player->mo, sfx_ffbonc);
 | 
			
		||||
			player->mo->momz = bounce * P_MobjFlip(player->mo);
 | 
			
		||||
			// Lose speed on bad bounce.
 | 
			
		||||
			player->mo->momx /= 2;
 | 
			
		||||
			player->mo->momy /= 2;
 | 
			
		||||
 | 
			
		||||
			if (bounce < minBounce)
 | 
			
		||||
			{
 | 
			
		||||
				bounce = minBounce;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		S_StartSound(player->mo, sfx_ffbonc);
 | 
			
		||||
		player->mo->momz = bounce * P_MobjFlip(player->mo);
 | 
			
		||||
 | 
			
		||||
		player->fastfall = 0;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue