mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2025-09-06 08:20:15 +02:00
TDrain, TKickout, TLightBargraph, TPopupTarget, TSoloTarget ready.
This commit is contained in:
parent
ffd626fbc1
commit
7e8f52c156
21 changed files with 840 additions and 29 deletions
|
@ -126,3 +126,15 @@ int TBall::Message(int code, float value)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TBall::throw_ball(TBall* ball, vector_type* acceleration, float angleMult, float speedMult1, float speedMult2)
|
||||
{
|
||||
ball->CollisionComp = nullptr;
|
||||
ball->Acceleration = *acceleration;
|
||||
float rnd = static_cast<float>(rand());
|
||||
float angle = (1.0f - (rnd * 0.00003051850947599719f + rnd * 0.00003051850947599719f)) * angleMult;
|
||||
maths::RotateVector(&ball->Acceleration, angle);
|
||||
rnd = static_cast<float>(rand());
|
||||
ball->Speed = (1.0f - (rnd * 0.00003051850947599719f + rnd * 0.00003051850947599719f)) * (speedMult1 *
|
||||
speedMult2) + speedMult1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue