2020-11-01 16:45:29 +01:00
|
|
|
#include "pch.h"
|
|
|
|
#include "TTripwire.h"
|
2021-01-08 16:50:12 +01:00
|
|
|
|
|
|
|
#include "control.h"
|
|
|
|
#include "loader.h"
|
|
|
|
#include "TBall.h"
|
|
|
|
#include "TPinballTable.h"
|
|
|
|
|
2021-10-23 06:33:04 +02:00
|
|
|
TTripwire::TTripwire(TPinballTable* table, int groupIndex) : TRollover(table, groupIndex, true)
|
2021-01-08 16:50:12 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-05-11 15:47:13 +02:00
|
|
|
void TTripwire::Collision(TBall* ball, vector2* nextPosition, vector2* direction, float coef,
|
2021-01-08 16:50:12 +01:00
|
|
|
TEdgeSegment* edge)
|
|
|
|
{
|
|
|
|
ball->Position.X = nextPosition->X;
|
|
|
|
ball->Position.Y = nextPosition->Y;
|
|
|
|
ball->RayMaxDistance -= coef;
|
|
|
|
ball->not_again(edge);
|
|
|
|
if (!PinballTable->TiltLockFlag)
|
|
|
|
{
|
2021-01-23 11:33:30 +01:00
|
|
|
loader::play_sound(SoftHitSoundId);
|
2021-01-08 16:50:12 +01:00
|
|
|
control::handler(63, this);
|
|
|
|
}
|
|
|
|
}
|