The slide counter is needed to still be able to move the block aside once it hits the pile. Therefore, we must first know whether the block touches the pile. In that case it can not go down any further. In this case, we will reduce the value of ‘slideCounter’. When slideCounter reaches zero, we call the method handleBottomCollision.
if(!canMove(currentBlock, D_DOWN))
{
slideCounter -= Time.d();
} else {
5 slideCounter = SLIDE_TIME;
}
if(slideCounter <= 0)
{
10 slideCounter = SLIDE_TIME;
handleBottomCollision();
}