This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

kevv presents ...


Lab 3 - Music is fun

Plays sound with the keys 1-7 and the mouse
Background image from Garageband for iOS
All comments are welcome, especially suggestions on how to make the code look more correct.

2923 views / 399 in the last 7 days

4 votes | 0 in the last 7 days

Tags: simulation with-source

open in greenfoot
Your browser does not support the canvas tag.


You used the image from garageband for iOS....


Sorry if that is bad. Just googled drums and found a suitable one. I'll send an email and ask if it is ok with them. :)


the lower 3 are wrong though.. d snare is at at the left but u have its sound on the right, the base is in the middle but u have its sound on the snare, and d sound u have on the bass is from the one on the right.


I know, I added the sounds in a rush. Main goal was to do the code as required.
A new version of this scenario was uploaded on Thu Nov 01 09:18:06 UTC 2012 Opened the code
A new version of this scenario was uploaded on Fri Nov 02 09:25:42 UTC 2012


Can u plz explain this part of your code for me? I understand that it's the delay for the loop but what does >0 then delay -- ??? private void delay() { if (delay > 0) { delay--; } if (delay == 0) { play(); delay = 15; } }


if delay is bigger than 0 it decreases by one. it keeps on doing it until delay equals 0. then the sound method plays and the value of delay is set to 15 again.

Want to leave a comment? You must first log in.

Who likes this?

davemib123 lonely.girl SSS militant