bubbles
This commit is contained in:
parent
ed87752159
commit
49b09b9bb8
9 changed files with 77 additions and 12 deletions
18
scenes/bubbles.gd
Normal file
18
scenes/bubbles.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
extends GPUParticles3D
|
||||
|
||||
|
||||
@export var inventory: Inventory
|
||||
@export var particles: GPUParticles3D
|
||||
var tween: Tween
|
||||
|
||||
func _on_inventory_reacted_with_gasses(gasses: Array[RuntimeSubstanceData]) -> void:
|
||||
if tween:
|
||||
tween.kill()
|
||||
tween = create_tween()
|
||||
particles.emitting = true
|
||||
tween.tween_interval(2.)
|
||||
tween.tween_callback(func():
|
||||
particles.emitting = false
|
||||
for gas in gasses:
|
||||
inventory.extract_substance(gas.substance.get_formula(),gas.amount)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue