Created
January 31, 2017 20:43
-
-
Save jhauge/080e1915186d7ad478d6470100fae0c9 to your computer and use it in GitHub Desktop.
bitbox homework app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup | |
fill('balsa') | |
homework = stamp('homework') | |
exploding = true | |
alarm = stamp('alarm',650,100,180) | |
alarm.tap = soundAlarm | |
// Start nedtælling til eksplosion | |
function soundAlarm() { | |
sound('alert',25,100) | |
alarm.tap = silenceAlarm | |
exploding = true | |
delay(explode,5000) | |
} | |
// Eksploder, hvis vi stadig vil eksplodere | |
function explode() { | |
if (exploding) { | |
silence() | |
sound('explode') | |
homework.explode() | |
} | |
} | |
// Stop nedtælling og eksplosion | |
function silenceAlarm() { | |
silence() | |
sound('applause') | |
exploding = false | |
alarm.tap = soundAlarm | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment