sun_burst.gd 496 B

1234567891011
  1. extends CPUParticles2D
  2. ## The cocos2d-x ParticleSun preset used when a ball falls out: 350 soft additive particles
  3. ## per second for one second, drifting slowly outwards and fading from dark orange to black.
  4. ## The amount/lifetime pair in the scene gives that rate with lifetimes of 0.5 to 1.5 s.
  5. const DURATION := 1.0
  6. func _ready() -> void:
  7. get_tree().create_timer(DURATION).timeout.connect(set_emitting.bind(false))
  8. get_tree().create_timer(DURATION + lifetime).timeout.connect(queue_free)