-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap_data.gd
More file actions
41 lines (35 loc) · 931 Bytes
/
map_data.gd
File metadata and controls
41 lines (35 loc) · 931 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
extends Node
const MAPFILE : String = 'user://MAPFILE.save'
var room_state_dict : Dictionary = {
'level_movement' : false,
'level_jumps' : false,
'level_jumps_complex_A': false,
'level_jumps_complex_B': false,
'level_jumps_and_boxes_A': false,
'level_jumps_and_boxes_B' : false,
'level_sword_range_A' : false,
'level_sword_range_B' : false,
'level_sword_range_C' : false,
'level_sword_range_D' : false,
'level_4': false,
'level_4_2': false,
'level_3': false,
'level_2': false,
'level_1B': false,
'level_1A': false
}
var current_room : String
func load_data():
var file = FileAccess.open(MAPFILE,FileAccess.READ)
if file == null:
save_data()
else:
var full_data = file.get_var()
print(full_data)
room_state_dict = full_data
file = null
func save_data():
var file = FileAccess.open(MAPFILE, FileAccess.WRITE)
var full_data : Dictionary = room_state_dict
file.store_var(full_data)
file = null