From 1e479e6dffd92c80c121de66adaf94d600b64cf1 Mon Sep 17 00:00:00 2001 From: hilmizul Date: Fri, 22 Oct 2021 19:06:16 +0700 Subject: [PATCH] loop music and show instruction.. :D --- sketch.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sketch.js b/sketch.js index e86f086..3e02531 100644 --- a/sketch.js +++ b/sketch.js @@ -19,7 +19,7 @@ function setup() { rec.onResult = showResult; rec.start(); - musik.play(); + musik.loop(); } function showResult() { @@ -54,4 +54,12 @@ function draw() { t[i].fallDown(); t[i].checkEdge(); } + + if (rec.resultString === 'ball' || rec.resultString === 'triangle') { + // console.log('done.'); + } else { + textAlign(CENTER); + textSize(30); + text('Say: "ball" or "triangle"', width/2, 100); + } }