summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/index.js4
-rw-r--r--client/lib/life.js5
2 files changed, 7 insertions, 2 deletions
diff --git a/client/index.js b/client/index.js
index 106053b..d6dad6a 100644
--- a/client/index.js
+++ b/client/index.js
@@ -36,7 +36,9 @@ requestAudioContext( () => {
function play(freq) {
freq.playing = true
instrument.play(freq.frequency)
- freq.div.classList.add('playing')
+ if (instrument === organ || hash || life.isRunning()) {
+ freq.div.classList.add('playing')
+ }
life.assign_item(freq, true)
}
function pause(freq) {
diff --git a/client/lib/life.js b/client/lib/life.js
index 26ff0bf..e5df868 100644
--- a/client/lib/life.js
+++ b/client/lib/life.js
@@ -71,5 +71,8 @@ function fitness (old, score) {
}
return 0
}
+function isRunning() {
+ return !!timeout
+}
-export default { init, step, assign_item, toggle, setTempo } \ No newline at end of file
+export default { init, step, assign_item, toggle, setTempo, isRunning } \ No newline at end of file