27 lines
630 B
JavaScript
27 lines
630 B
JavaScript
|
|
function fillArray(name, number, playerAnim)
|
|
{
|
|
for (let i = 1 ; i <= number ; i++) {
|
|
playerAnim[i-1] = "pics/" + name + i + ".png";
|
|
}
|
|
}
|
|
function addToScore(currentScore,zahl,rechenOperator){
|
|
let ergebnis;
|
|
if(rechenOperator == "Plus"){
|
|
ergebnis = currentScore + zahl;
|
|
}
|
|
if(rechenOperator == "Minus"){
|
|
ergebnis = currentScore - zahl;
|
|
}
|
|
if(rechenOperator == "Mal"){
|
|
ergebnis = currentScore * zahl;
|
|
}
|
|
if(rechenOperator == "Geteilt"){
|
|
ergebnis = currentScore / zahl;
|
|
}
|
|
return ergebnis;
|
|
}
|
|
function addOneToStreak(win){
|
|
win++;
|
|
return win;
|
|
} |