Level 3
Using Level 3 to do a big art pass and get a lot of systems set up and cleaned up. Add Phantom Camera addon with comprehensive 2D/3D camera system
This commit is contained in:
1 parent
5ce882b53d
commit
2c6a395938
1122 files changed
+42103
-40
No files matched your search
+12
-5
@@ -45,20 +45,27 @@ func _ready() -> void:
|
||||
add_child(b)
|
||||
$Button0.pressed.connect(_on_button_pressed.bind(0))
|
||||
|
||||
reset()
|
||||
|
||||
func reset():
|
||||
pieces = []
|
||||
to_play = []
|
||||
guessed = []
|
||||
for i in Rounds:
|
||||
var item = randi() % len(PhoneSounds)
|
||||
pieces.append(item)
|
||||
to_play.append(item)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if guessed.size() >= pieces.size():
|
||||
if guessed == pieces:
|
||||
get_tree().change_scene_to_file("res://scenes/level_%s.tscn" % GloblaData.level)
|
||||
get_tree().change_scene_to_file("res://scenes/levels/level_%s.tscn" % GloblaData.level)
|
||||
else:
|
||||
_ready()
|
||||
reset()
|
||||
|
||||
if !$AudioStreamPlayer2D.playing and !to_play.is_empty():
|
||||
if !$AudioStreamPlayer.playing and !to_play.is_empty():
|
||||
actuate_button(to_play.pop_front())
|
||||
|
||||
for b in buttons:
|
||||
@@ -74,5 +81,5 @@ func actuate_button(button: int) -> void:
|
||||
var rect: ColorRect = buttons[button].get_child(1)
|
||||
rect.color = Color.from_rgba8(255, 255, 255, 255)
|
||||
|
||||
$AudioStreamPlayer2D.stream = PhoneSounds[button]
|
||||
$AudioStreamPlayer2D.play()
|
||||
$AudioStreamPlayer.stream = PhoneSounds[button]
|
||||
$AudioStreamPlayer.play()
|
||||
Reference in new issue
Block a user