Hello,
I am need help figuring out how to get my Simon Says game to pause after the button/color is selected, so that users are able to view the sequence of buttons to push. It also needs to pause so that the sound can play as well. I really want to create a function that pauses or delays my code long enough for the highlight and sound plays. I am pretty sure I need to put this pause in two places in my code, see below:
function randomPlay(){
for (i=0; i<order.length; i++){
if(order[i] == 1){
color = "red";
}else if (order[i] == 2){
color = "blue";
}else if (order[i] == 3){
color = "green";
}else if (order[i] == 4){
color = "yellow";
}soundBite();
highlight();
!!pause here!!
}
}
function nextTurn(){
count += 1;
$('#score_num').text(count);
check = [];
!!pause here!!
randomFun();
randomPlay();
$('#test').text(order);
}
Please let me know if I am on the right track or need to revamp my coding. Thanks in advance.