-
Notifications
You must be signed in to change notification settings - Fork 2
/
stats.lua
56 lines (51 loc) · 1.62 KB
/
stats.lua
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
49
50
51
52
53
54
55
56
local DIFFICULTY = require('difficulty')
return function(legacy)
local stats = {}
if not legacy then
-- Stats for games played in the default difficulty.
stats.normal = {
best_time = 0,
best_time_idol_count = 0,
best_time_death_count = 0,
least_deaths_completion = nil,
least_deaths_completion_time = 0,
max_idol_completions = 0,
max_idol_best_time = 0,
deathless_completions = 0,
best_level = nil,
completions = 0,
}
-- Stats for games played in the easy difficulty.
stats.easy = {
best_time = 0,
best_time_death_count = 0,
least_deaths_completion = nil,
least_deaths_completion_time = 0,
deathless_completions = 0,
best_level = nil,
completions = 0,
}
-- Stats for games played in the hard difficulty.
stats.hard = {
best_time = 0,
best_time_idol_count = 0,
best_time_death_count = 0,
least_deaths_completion = nil,
least_deaths_completion_time = 0,
max_idol_completions = 0,
max_idol_best_time = 0,
deathless_completions = 0,
best_level = nil,
completions = 0,
}
end
function stats.stats_for_difficulty(difficulty)
if difficulty == DIFFICULTY.HARD then
return stats.hard
elseif difficulty == DIFFICULTY.EASY then
return stats.easy
end
return stats.normal
end
return stats
end