Changing levels
I made it where if you beat phonephreak it moves you to the next level.
This commit is contained in:
1 parent
7ffc756b36
commit
61912a7df4
11 files changed
+95
-26
No files matched your search
@@ -22,6 +22,7 @@ const PhoneSounds = [
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
GloblaData.level += 1
|
||||
var origin = Vector2(150, 225)
|
||||
var offset = Vector2(135, 120)
|
||||
$Button0.position.y = origin.y + 3 * offset.y + 3 * -10
|
||||
@@ -40,7 +41,7 @@ func _ready() -> void:
|
||||
b.position.x = origin.x + row * offset.x + col+1 * -5
|
||||
b.pressed.connect(_on_button_pressed.bind(i+1))
|
||||
buttons.append(b)
|
||||
b.name = "Button%i" %(i)
|
||||
b.name = "Button%s" %(i)
|
||||
add_child(b)
|
||||
$Button0.pressed.connect(_on_button_pressed.bind(0))
|
||||
|
||||
@@ -53,9 +54,9 @@ func _ready() -> void:
|
||||
func _process(delta: float) -> void:
|
||||
if guessed.size() >= pieces.size():
|
||||
if guessed == pieces:
|
||||
print("Got it")
|
||||
get_tree().change_scene_to_file("res://scenes/level_%s.tscn" % GloblaData.level)
|
||||
else:
|
||||
print("Nope")
|
||||
_ready()
|
||||
|
||||
if !$AudioStreamPlayer2D.playing and !to_play.is_empty():
|
||||
actuate_button(to_play.pop_front())
|
||||
|
||||
Reference in new issue
Block a user