xxxxxxxxxx
34
let timer;
let timerOver=false;
function preload(){
// soundFormats('mp3');
mySound = loadSound('bell.mp3');
}
function setup() {
createCanvas(windowWidth, windowHeight);
// timer = 1000 * 60 * 20
timer = 1000 * 60 * 2
// timer= 10
}
function draw() {
background(220);
timer -= deltaTime
print(deltaTime)
text(nfc(timer/10000,0)+ " minutes remaining",width/2,height/2)
text(nfc(timer/1000,0)+ " seconds remaining",width/2,height/2+40)
if(timer < 0 ){
mySound.play();
timer=4000;
}
}