Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSam Sandeep

Posted 10 January 2013 - 03:52 AM

As Endurion pointed out just use the bool in the condition for collision.

if(g_bBlock[4].m_bActive_three==true)
{
if(x>=3.0f && x<=5.0f && y>=3.5f && y<=4.0f)
{
ystep = -ystep;
g_bBlock[4].m_bActive_three=false;
}
}

But trust me, there are much more efficient ways of detecting collision and removing the blocks.  The one you are using is probably the easiest but not accurate in many cases.


#1Sam Sandeep

Posted 10 January 2013 - 03:51 AM

As Endurion pointed out just use the bool in the condition for collision.
 


 

if(g_bBlock[4].m_bActive_three==true)
{
if(x>=3.0f && x<=5.0f && y>=3.5f && y<=4.0f)
{
ystep = -ystep;
g_bBlock[4].m_bActive_three=false;
}
}

But trust me, there are much more efficient ways of detecting collision and removing the blocks.  The one you are using is probably the easiest but not accurate in many cases.


PARTNERS