-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameEvents.js
48 lines (36 loc) · 1.04 KB
/
gameEvents.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Created by KurekB on 2016-11-17.
*/
var gamesWon=0;
function onWinEvent(){
winLoseImage=document.getElementById("winLosInformation");
winLoseImage.src="img/Win_Information.png";
console.log("You won");
gamesWon++;
if(gamesWon===2)
makeMichiganFrogDanceToHelloMyBaby();
else if(gamesWon===3)
makeMichiganFrogDanceToMichiganRide();
else if(gamesWon===4)
makeMichiganFrogDanceToOpera();
}
function onLostEvent(){
var winLoseImage=document.getElementById("winLosInformation");
winLoseImage.src="img/Lose_Information.png";
console.log("You lost");
}
function onSpinnerStopped(winningSymbolPositionInArray){
isSpinnerRunning=false;
answersComboBox.disabled=false;
spinButton.disabled=false;
spinButton.src="img/BTN_Spin.png";
console.log(winningSymbolPositionInArray);
if(objectsMatchesArray[winningSymbolPositionInArray].imageName===answersComboBox.value){
onWinEvent();
console.log("wygrałes");
}
else
{
onLostEvent();
}
}