Maybe I should be getting it inside the FINGER DOWN?
I tried that last night, i believe it was returning 0 and 1 values, but for some reason wasn’t working as it should.
if (event.type == SDL_FINGERDOWN)
{
bFingerDown = true;
if (CheckButtonsSingle( iMouseX, iMouseY ) == true && bf1 == true)
{
if (bButton1 == true)
{
if ( Ball0->CheckColide( Player0->GetXpos(), Player0->GetYpos(), Player0->GetZpos() ) == true )
{
Ball0->KickBall(Player0->GetVector(0), Display0->GetMatrix(6), Player0->GetVector(2), 3 , Player0->GetPlayerNum() );
}
}
else if (bButton2 == true)
{
if ( Ball0->CheckColide( Player0->GetXpos(), Player0->GetYpos(), Player0->GetZpos() ) == true )
{
Ball0->KickBall(Player0->GetVector(0), Display0->GetMatrix(6), Player0->GetVector(2), 4, Player0->GetPlayerNum() );
}
}
else if (bButton3 == true && iSecondOld < Clock0->GetSeconds() ) // KICK
{
if ( Ball0->CheckColide( Player0->GetXpos(), Player0->GetYpos(), Player0->GetZpos() ) == true )
{
Ball0->KickBall(Player0->GetVector(0), Display0->GetMatrix(6), Player0->GetVector(2), 6 , Player0->GetPlayerNum() );
}
}
}
else if (CheckButtonsSingle( iMouseX2, iMouseY2 ) == true && bf2 == true)
{
if (bButton1 == true)
{
if ( Ball0->CheckColide( Player0->GetXpos(), Player0->GetYpos(), Player0->GetZpos() ) == true )
{
Ball0->KickBall(Player0->GetVector(0), Display0->GetMatrix(6), Player0->GetVector(2), 3 , Player0->GetPlayerNum() );
}
}
else if (bButton2 == true)
{
if ( Ball0->CheckColide( Player0->GetXpos(), Player0->GetYpos(), Player0->GetZpos() ) == true )
{
Ball0->KickBall(Player0->GetVector(0), Display0->GetMatrix(6), Player0->GetVector(2), 4, Player0->GetPlayerNum() );
}
}
else if (bButton3 == true && iSecondOld < Clock0->GetSeconds() ) // KICK
{
if ( Ball0->CheckColide( Player0->GetXpos(), Player0->GetYpos(), Player0->GetZpos() ) == true )
{
Ball0->KickBall(Player0->GetVector(0), Display0->GetMatrix(6), Player0->GetVector(2), 6 , Player0->GetPlayerNum() );
}
}
}
bButton1 = false;
bButton2 = false;
bButton3 = false;
if (event.type == SDL_FINGERUP)
{
if (event.tfinger.fingerId == 0 )
{
bf1 = false; // ture
iMouseX = -1;
iMouseY = -1;
}
if (event.tfinger.fingerId == 1 )
{
bf1 = true;
bf2 = false; // false
iMouseX2 = -1;
iMouseY2 = -1;
}
//RESET MOUSEOLDS
iMouseXold = -1;
iMouseYold = -1;
//bFingerDown = false;
}