IOCT Masters in Creative Technogies
Major Project
An augmented reality game based on "Breakout"

Tuesday 22 July 2008

Brick cracks

In levels two and three the bricks are not deleted on their first contact with the ball. To show the player which bricks have been hit, I have coded a crack design. The cracks appear in level two once a brick has been hit once. In level three two cracks appear on the brick after the first collision and then another crack appears after the second collision.

To design the cracks I tried a variety of designs on a printscreen of the bricks, using Microsoft Paintbrush. Once I had chosen the brick crack preferred design, I then calculated the pixels which were part of the crack and coded this using the cvLine command. The cracks are created by coding a series of small lines.

The code is divided into three sections, one for each crack. In level two cracks one, two and three appear on the first collision. In level three cracks one and two appear after the first collision and crack three appears after the second collision.