Sliding behavior and horizontal collision detection for shapes implemented