mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2023-12-30 21:52:56 +00:00
parent
5e42f37fba
commit
eed3662592
@ -60,14 +60,17 @@ bool TCollisionComponent::DefaultCollision(TBall* ball, vector2* nextPosition, v
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool collision = false;
|
||||||
auto projSpeed = maths::basic_collision(ball, nextPosition, direction, Elasticity, Smoothness, Threshold, Boost);
|
auto projSpeed = maths::basic_collision(ball, nextPosition, direction, Elasticity, Smoothness, Threshold, Boost);
|
||||||
if (projSpeed > Threshold)
|
if (projSpeed > Threshold)
|
||||||
|
{
|
||||||
loader::play_sound(HardHitSoundId, ball, "TCollisionComponent1");
|
loader::play_sound(HardHitSoundId, ball, "TCollisionComponent1");
|
||||||
|
collision = true;
|
||||||
|
}
|
||||||
else if (projSpeed > 0.2f)
|
else if (projSpeed > 0.2f)
|
||||||
loader::play_sound(SoftHitSoundId, ball, "TCollisionComponent2");
|
loader::play_sound(SoftHitSoundId, ball, "TCollisionComponent2");
|
||||||
else
|
|
||||||
return false;
|
return collision;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCollisionComponent::Collision(TBall* ball, vector2* nextPosition, vector2* direction,
|
void TCollisionComponent::Collision(TBall* ball, vector2* nextPosition, vector2* direction,
|
||||||
|
Loading…
Reference in New Issue
Block a user