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

Tuesday 22 July 2008

Coding the brick collision effects

To code the brick collision effects I have included checks in an if statement, to check once the brick has been hit if the hit number matches the level number. In the first level, if the brick has been hit once then the player will hear an explosion effect whilst the brick disappears. In the second level of the game, the first time a brick is hit (which is one number less than the level number) the player hears a collision noise and cracks appear on the brick. The second time a brick is hit (the same number of hits as the level number) the player hears an explosion noise and the brick disappears. In the third level, the first hit creates a collision noise and two cracks appear on the brick (this is two hits less than the level number), the second hit creates a collision noise and another crack appears (this is one hit less than the level number) and the third hit causes an explosion noise and the brick disappears (as the hit number equals the level number).