level now detects (in a very rudimentary way, by checking every frame) whether all blocks have been broken

This commit is contained in:
2024-07-23 20:53:55 +02:00
parent eeffba61b6
commit 9ae0d04136
6 changed files with 40 additions and 75 deletions
+14
View File
@@ -0,0 +1,14 @@
extends Node2D
var _current_level = 1
var ball_scene = preload("res://balls/basic/ball_basic.tscn")
func _on_button_pressed():
var new_ball = ball_scene.instantiate()
new_ball.global_position = $GameContent/BallSpawn.global_position
$GameContent/Balls.add_child(new_ball)
func _physics_process(delta):
if $GameContent/Blocks.get_children().size() == 0:
_current_level += 1
print("DONE")