Skip to content

Commit

Permalink
hardcode lock_string into lockdict
Browse files Browse the repository at this point in the history
  • Loading branch information
HarmonyHoney committed Jan 16, 2025
1 parent 0c7cc46 commit f158d24
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 31 deletions.
18 changes: 1 addition & 17 deletions src/autoload/Shared.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var save_filename := "box.save"
var keys_path := "keys.tres"
var options_path := "options.tres"
var scene_dict := {}
export var is_scene_dict_refresh := false setget set_is_scene_dict_refresh
var replays := [{}, {}, {}]
var is_save := false
var last_menu := "main"
Expand Down Expand Up @@ -121,9 +120,6 @@ func _input(event):
if is_gamepad != joy:
is_gamepad = joy
emit_signal("signal_gamepad")

if event.is_action_pressed("debug_refresh"):
refresh_scenes()

func _physics_process(delta):
if is_level_select or is_in_game or is_creator:
Expand Down Expand Up @@ -157,25 +153,13 @@ func _physics_process(delta):

### Changing Maps

func set_is_scene_dict_refresh(arg := false):
is_scene_dict_refresh = false
refresh_scenes()
print("set_is_scene_dict_refresh ", arg)

func refresh_scenes():
var k = scene_dict.keys().duplicate()
scene_dict.clear()

for i in k:
scene_dict[i] = load(i)

func wipe_scene(arg := scene_path, timer := 0.0):
if Wipe.is_wipe: return
if timer > 0.0:
yield(get_tree().create_timer(timer), "timeout")
if Wipe.is_wipe: return
scene_last = scene_path
scene_path = arg
scene_path = arg.replace(" ", "")
Wipe.start()

func wipe_quit():
Expand Down
23 changes: 15 additions & 8 deletions src/menu/select.gd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ var map_lock := {}
var map_list := []
var map_rows := []
var map_unlocked := []
export(String, MULTILINE) var lock_string := ""
var map_vector = {}
var is_faster = false
var is_faster_note = false
Expand All @@ -62,6 +61,14 @@ export var blink_off := 0.2
var blink_clock := 0.0
var blink_count = 10

var lockdict= {0:["1-1", "1-2", "1-3", "1-4", "1-5", "1-6", "1-7", "1-8"],
6 : ['2-1', '2-2', '2-3', '2-4', '2-5', '2-6', '2-7', '2-8'],
12: ['3-1', '3-2', '3-3', '3-4', '3-5', '3-6', '3-7', '3-8'],
18: ['4-1', '4-2', '4-3', '4-4', '4-5', '4-6', '4-7', '4-8'],
24: ['5-1', '5-2', '5-3', '5-4'],
30: ['win']}


func _ready():
#Leaderboard.connect("new_score", self, "new_score")
#SilentWolf.Scores.connect("sw_scores_received", self, "new_score")
Expand All @@ -73,14 +80,13 @@ func _ready():
# Audio.play("menu_bell", 0.8, 1.2)

# setup maps & locks
for i in lock_string.split("\n"):
var s : Array = i.split(" ")
var c = int(s.pop_front())
for i in lockdict.keys():
var s = lockdict[i]
map_rows.append(s)
for x in s:
map_lock[x] = c
map_lock[x] = i
map_list.append(x)
if c - 1 < Shared.count_gems:
if i - 1 < Shared.count_gems:
map_unlocked.append(x)
print("map_lock: ", map_lock)
print("map_rows: ", map_rows)
Expand Down Expand Up @@ -183,8 +189,9 @@ func _physics_process(delta):
while OS.get_ticks_msec() < ticks + (delta * timeout_mod):
if load_list.size() > 0:
var pop = load_list.pop_front()
pop[2].add_child(Shared.scene_dict[pop[1]].instance())
screen_static[pop[0]].visible = false
if Shared.scene_dict.has(pop[1]):
pop[2].add_child(Shared.scene_dict[pop[1]].instance())
screen_static[pop[0]].visible = false
else:
is_load = false
print(loading_time, " loading time")
Expand Down
6 changes: 0 additions & 6 deletions src/menu/select.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ __meta__ = {
"_edit_lock_": true
}
screen_size = Vector2( 136, 96 )
lock_string = "00 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8
06 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8
12 3-1 3-2 3-3 3-4 3-5 3-6 3-7 3-8
18 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8
24 5-1 5-2 5-3 5-4
30 win"

[node name="Control" type="Control" parent="."]
margin_right = 320.0
Expand Down

0 comments on commit f158d24

Please sign in to comment.