-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.rb
More file actions
42 lines (32 loc) · 667 Bytes
/
Copy pathsave.rb
File metadata and controls
42 lines (32 loc) · 667 Bytes
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
require 'inifile'
require_relative 'l1'
$save = IniFile.load('save.ini')
def load_game(level)
current = $save['current']['status']
end
def save_game(current_level)
$save['current']['status'] = current_level.to_s
$save.save
end
def save_level(level, score)
$save[level.to_s]['status'] = score.to_s
$save.save
end
def save_answer(question, answer)
answer = IniFile.load('answer.ini')
answer['answerslog'][question.to_s] = answer.to_s
answer.save
end
def new_game
$save['current']['status'] = 1
$save.save
level1()
end
def next_level(level, def_)
def_
end
if __FILE__ == $0
puts load_game
save_game('3b')
save_level(1, 0.423)
end