1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-11-17 23:20:19 +01:00
SpaceCadetPinball/SpaceCadetPinball/TTripwire.cpp
2021-01-23 13:33:30 +03:00

25 lines
616 B
C++

#include "pch.h"
#include "TTripwire.h"
#include "control.h"
#include "loader.h"
#include "TBall.h"
#include "TPinballTable.h"
TTripwire::TTripwire(TPinballTable* table, int groupIndex) : TRollover(table, groupIndex, 1)
{
}
void TTripwire::Collision(TBall* ball, vector_type* nextPosition, vector_type* direction, float coef,
TEdgeSegment* edge)
{
ball->Position.X = nextPosition->X;
ball->Position.Y = nextPosition->Y;
ball->RayMaxDistance -= coef;
ball->not_again(edge);
if (!PinballTable->TiltLockFlag)
{
loader::play_sound(SoftHitSoundId);
control::handler(63, this);
}
}