Thursday, 5 May 2011

Project 2-Final Code

I have finished my final code!
I spent five hours studing what an Array was and how to used it but got so puzzled by it i couldn't apply it to my own applicating. Because of this i was left to writing the 105 lines of code. I didnt take to long but made my code very long. Luckily it wasn't to hard, my variable were named based on the colours and number of circle eg r1, r2, b1, b2.

SOUND:

I made some simple piano note on garage band to use in my code.
I then added the sounds to it. All i had to do was ad an if statement to each line (circles touching) to trigger it to play a piano note. When they were all finished it sounded really good. The notes built up nicely when you more circles touched. The sound of the piano did not make one constant sounch as if you were holding a note down on a piano because the computer is told to repeat the mp3 i haded. It made the note repeat continuously like a drum but i like how it sounded as they were interesting when lots were added together.

Lastly i added a reset button so that all the circle move back to their original place. This helped hugely because the circles could easily get messed around and it was nice to start again when the sounds got to much.

No comments:

Post a Comment