Blockwick 2 Rounded Corner Collisions

To make dragging blocks user-friendly, rounded corners for our collision objects are key. Getting stuck on a corner is frustrating and detractive. We want people to solve puzzles not fight with the game.

blockwick_2_rounded_corner_collisions

As this was our first project using Unity 3D, I was excited to use the built-in physics and save some time. Setting up the shapes and mechanics was simple enough, but after a week of prototyping, it was clear that standard game physics were not going to cut it. Physics instabilities, catches on invisible corners, extra processing for things like rotations, forces, collision event callbacks, etc. It was too general a solution for a specific problem.

All of the above considered, it was necessary to create a custom physics solutions that only took into account what we needed: rounded corners and non-overlapping collisions.

I just need two types of collision shapes, edges and corners. An edge is simply a box with a normal vector. A corner is a circle and box that defines what quadrant of the circle to use. The one constraint of the system is that blocks should never move farther than the radius of a corner. That’s pretty much it!

Now, all we have to do is move the selected block towards the touch location and iterate over the collider arrays, moving the colliders away from each other based on edge normals and corner quadrants. To move blocks faster do more physics steps each frame.

Blockwick 2 is coming to iOS and Android next Thursday, March 5th. Check out Blockwick.com for more information.