equal
deleted
inserted
replaced
393 end |
393 end |
394 |
394 |
395 -- This function calculates the final score of the player and provides some texts and |
395 -- This function calculates the final score of the player and provides some texts and |
396 -- data for the final stats screen |
396 -- data for the final stats screen |
397 function generateStats() |
397 function generateStats() |
398 local accuracy = (score/shots)*100 |
398 local accuracy = 0 |
|
399 if shots > 0 then |
|
400 accuracy = (score/shots)*100 |
|
401 end |
399 local end_score_targets = (score_bonus * 200) |
402 local end_score_targets = (score_bonus * 200) |
400 local end_score_overall |
403 local end_score_overall |
401 if not game_lost then |
404 if not game_lost then |
402 local end_score_time = math.ceil(time_goal/5) |
405 local end_score_time = math.ceil(time_goal/5) |
403 local end_score_accuracy = math.ceil(accuracy * 100) |
406 local end_score_accuracy = math.ceil(accuracy * 100) |