brick collision detection and reaction