|
|
@@ -3,6 +3,7 @@ extends Node2D
|
|
|
|
|
|
const BALL_SCENE := preload("res://scenes/ball.tscn")
|
|
|
const POWER_UP_SCENE := preload("res://scenes/power_up.tscn")
|
|
|
+const SUN_BURST_SCENE := preload("res://scenes/sun_burst.tscn")
|
|
|
|
|
|
var level := 0
|
|
|
## Set once the level is won or lost; stops power-up drops and collision handling.
|
|
|
@@ -199,27 +200,10 @@ func _alert(text: String) -> void:
|
|
|
tween.tween_callback(label.queue_free)
|
|
|
|
|
|
|
|
|
-## A short orange flash where a ball fell out.
|
|
|
func _burst(at: Vector2) -> void:
|
|
|
- var particles := CPUParticles2D.new()
|
|
|
- particles.position = at
|
|
|
- particles.one_shot = true
|
|
|
- particles.amount = 80
|
|
|
- particles.lifetime = 1.0
|
|
|
- particles.explosiveness = 0.9
|
|
|
- particles.spread = 180.0
|
|
|
- particles.gravity = Vector2.ZERO
|
|
|
- particles.initial_velocity_min = 40.0
|
|
|
- particles.initial_velocity_max = 160.0
|
|
|
- particles.scale_amount_min = 3.0
|
|
|
- particles.scale_amount_max = 6.0
|
|
|
- var ramp := Gradient.new()
|
|
|
- ramp.set_color(0, Color(1.0, 0.85, 0.3))
|
|
|
- ramp.set_color(1, Color(1.0, 0.3, 0.0, 0.0))
|
|
|
- particles.color_ramp = ramp
|
|
|
- particles.finished.connect(particles.queue_free)
|
|
|
- add_child(particles)
|
|
|
- particles.emitting = true
|
|
|
+ var burst: CPUParticles2D = SUN_BURST_SCENE.instantiate()
|
|
|
+ burst.position = at
|
|
|
+ add_child(burst)
|
|
|
|
|
|
|
|
|
func _now() -> float:
|