FEE_MathRunner/js/funktionen.js

27 lines
630 B
JavaScript
Raw Normal View History

2024-06-27 09:36:34 +02:00
function fillArray(name, number, playerAnim)
{
2024-06-27 09:39:52 +02:00
for (let i = 1 ; i <= number ; i++) {
2024-06-27 10:31:37 +02:00
playerAnim[i-1] = "pics/" + name + i + ".png";
}
2024-06-27 11:01:20 +02:00
}
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;
}
2024-08-22 09:59:10 +02:00
if(rechenOperator == "Geteilt"){
2024-06-27 11:01:20 +02:00
ergebnis = currentScore / zahl;
}
return ergebnis;
}
function addOneToStreak(win){
win++;
return win;
}