1
0

LS03-04-2: Highscoreberechnung

This commit is contained in:
2021-06-15 21:12:51 +02:00
parent 47d54416c7
commit 7b4d78c1e0
2 changed files with 9 additions and 10 deletions
@@ -34,13 +34,13 @@ public class AttemptController {
}
/**
* calculates points from attempt for highscore TODO create formula here
* calculates points from attempt for highscore
*
* @param level Levelobjekt
* @param hitcounter Controllerobjekt das die Treffer und Reaktionszeiten misst
* @return points
*/
public int calculatePoints(Level level, HitCounter hitcounter) {
return -1;
return (int) ((hitcounter.getHit()/level.getTargets().size())* 400L +(hitcounter.getHit()/hitcounter.getShots())* 200L +(1000-(hitcounter.getReactionTime()/hitcounter.getSumReactionDiffernce())*400));
}
}