previous

page 13

next
function button_click(colr) {
Hide('buttons');
g_n++;
if (g_cards[1]==g_cards[4]) {
if (colr=='green') g_score++;
} else {
if (colr=='red') g_score++;
}
var image=document.getElementById(1);
image.src='cards/'+g_cards[1]+'.png';
var image=document.getElementById(4);
image.src='cards/'+g_cards[4]+'.png';
// wait two seconds
for (var i=0;i<5;i++) {
var image=document.getElementById(i);
image.src='cards/back.png';
}
pick0();
var image=document.getElementById(0);
image.src='cards/'+g_cards[0]+'.png';
// wait three seconds
var image=document.getElementById(0);
image.src='cards/back.png';
move();
for (var j=4; j>0; j--) g_cards[j]=g_cards[j-1];
// when move finished
Show('buttons');
}
previous
next