2024-07-23 20:53:55 +02:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
|
|
var _current_level = 1
|
2024-07-23 21:09:04 +02:00
|
|
|
var ball_basic_scene = preload("res://balls/basic/ball_basic.tscn")
|
|
|
|
|
var ball_speed_scene = preload("res://balls/speed/ball_speed.tscn")
|
2024-07-23 20:53:55 +02:00
|
|
|
|
|
|
|
|
func _physics_process(delta):
|
|
|
|
|
if $GameContent/Blocks.get_children().size() == 0:
|
|
|
|
|
_current_level += 1
|
|
|
|
|
print("DONE")
|
2024-07-23 21:09:04 +02:00
|
|
|
|
|
|
|
|
func _on_button_basic_ball_pressed():
|
|
|
|
|
var new_ball = ball_basic_scene.instantiate()
|
|
|
|
|
new_ball.global_position = $GameContent/BallSpawn.global_position
|
|
|
|
|
$GameContent/Balls.add_child(new_ball)
|
|
|
|
|
|
|
|
|
|
func _on_button_speed_ball_pressed():
|
|
|
|
|
var new_ball = ball_speed_scene.instantiate()
|
|
|
|
|
new_ball.global_position = $GameContent/BallSpawn.global_position
|
|
|
|
|
$GameContent/Balls.add_child(new_ball)
|